Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOMNI committed Dec 10, 2024
1 parent b712d43 commit 1cc3f68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Codec/Tests/CodecTests/DecoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ struct DecoderTests {
#expect(throws: DecodingError.self) {
_ = try JamDecoder.decode([String: [Int]].self, from: corruptedEncodedData)
}
#expect(throws: DecodingError.self) {
_ = try JamDecoder.decode([String: [Int]]?.self, from: corruptedEncodedData)
}
}

@Test func decodeEmptyDataForArray() throws {
Expand Down
3 changes: 3 additions & 0 deletions Codec/Tests/CodecTests/IntegerCodecTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,8 @@ import Testing
#expect(data.decode() == nil)
#expect(data.decode(length: 20) as UInt64? == nil)
#expect(data.decode(length: -1) as UInt64? == nil)
var emptyBytes: [UInt8] = []
let result = IntegerCodec.decode { emptyBytes.popLast() }
#expect(result == nil)
}
}

0 comments on commit 1cc3f68

Please sign in to comment.