Skip to content

Commit

Permalink
test correct decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
swhitty committed Jun 27, 2024
1 parent 5ad6cc3 commit 1a192de
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tests/KeyValueDecoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ final class KeyValueDecoderTests: XCTestCase {
)

XCTAssertThrowsError(
try KeyValueDecoder.decode(Int8.self, from: Double(Int16.max))
try decoder.decode(Int8.self, from: Double(Int16.max))
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(Int8.self, from: NSNumber(value: Double(Int16.max)))
try decoder.decode(Int8.self, from: NSNumber(value: Double(Int16.max)))
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(Int16.self, from: Optional<Double>.none)
try decoder.decode(Int16.self, from: Optional<Double>.none as Any)
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(Int16.self, from: NSNull())
try decoder.decode(Int16.self, from: NSNull())
)
}

Expand Down Expand Up @@ -248,19 +248,19 @@ final class KeyValueDecoderTests: XCTestCase {
)

XCTAssertThrowsError(
try KeyValueDecoder.decode(UInt8.self, from: Double(Int16.max))
try decoder.decode(UInt8.self, from: Double(Int16.max))
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(UInt8.self, from: NSNumber(value: Double(Int16.max)))
try decoder.decode(UInt8.self, from: NSNumber(value: Double(Int16.max)))
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(UInt16.self, from: Double(-1))
try decoder.decode(UInt16.self, from: Double(-1))
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(UInt16.self, from: Optional<Double>.none)
try decoder.decode(UInt16.self, from: Optional<Double>.none as Any)
)
XCTAssertThrowsError(
try KeyValueDecoder.decode(UInt16.self, from: NSNull())
try decoder.decode(UInt16.self, from: NSNull())
)
}

Expand Down

0 comments on commit 1a192de

Please sign in to comment.