Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
990 B · 32 lines
Swift
at main
123456789101112131415161718192021222324252627282930313233//// XCTAssertDecoder.swift// URLQueryItemCoder//// Created by Kyle Hughes on 12/29/22.//
#if canImport(Combine)import Combineimport XCTest
@testable import URLQueryItemCoder
public func XCTAssertDecoder<Decoder, Output>( _ decoder: (DecodingStrategies) -> Decoder, decodes value: (Output, EncodingStrategies) -> Decoder.Input, encodedWith encodingStrategies: EncodingStrategies, decodedWith decodingStrategies: DecodingStrategies, as expectation: Output, file: StaticString = #filePath, line: UInt = #line) where Decoder: TopLevelDecoder, Decoder.Input: Equatable, Output: Decodable & Equatable { do { let inputValue = value(expectation, encodingStrategies) let decodedValue = try decoder(decodingStrategies).decode(Output.self, from: inputValue) XCTAssertEqual(decodedValue, expectation, file: file, line: line) } catch { XCTFail(error.localizedDescription, file: file, line: line) }}#endif