File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class CBORParserTests: XCTestCase {
2222 // Test Examples taken from Appendix A of RFC 7049
2323
2424 var value : Any !
25-
25+
2626 XCTAssertNoThrow ( value = try CBORParser . parse ( convertFromHexString ( " 0x00 " ) ) )
2727 XCTAssertTrue ( value is UInt64 )
2828 XCTAssertEqual ( value as! UInt64 , 0 )
@@ -1075,6 +1075,18 @@ class CBORParserTests: XCTestCase {
10751075
10761076 XCTAssertThrowsError ( try CBORParser . testCreateCodingKey ( from: UInt64 . max) )
10771077 }
1078+
1079+ func testSlicedDataInput( ) {
1080+ var value : Any !
1081+
1082+ // Skip over the first 2 bytes with a slice.
1083+ let data = convertFromHexString ( " 0x000000 " ) [ 2 ... ]
1084+
1085+ XCTAssertNoThrow ( value = try CBORParser . parse ( data) )
1086+ XCTAssertTrue ( value is UInt64 )
1087+ XCTAssertEqual ( value as! UInt64 , 0 )
1088+
1089+ }
10781090
10791091 // MARK: Private Methods
10801092
You can’t perform that action at this time.
0 commit comments