File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class SimpleStreamTests : XCTestCase {
33
33
let ds = SimpleDataStream ( data: d)
34
34
let rd = try ds. readData ( upTo: [ delim] , matchingMode: . anyMatchWins, includeDelimiter: false ) . data
35
35
XCTAssert ( rd == Data ( hexEncoded: " 01 23 " ) !)
36
+
37
+ let nx = try ds. readData ( size: 1 )
38
+ XCTAssert ( nx == Data ( hexEncoded: " 45 " ) !)
36
39
}
37
40
38
41
func testDataStreamReadToEnd( ) throws {
@@ -81,7 +84,7 @@ class SimpleStreamTests : XCTestCase {
81
84
defer { buffer. deallocate ( ) }
82
85
83
86
let fh = try FileHandle ( forReadingFrom: tmpFileURL)
84
- fh. closeFile ( ) /* Make the reads following this line fail on purpose */
87
+ try fh. close ( ) /* Make the reads following this line fail on purpose */
85
88
86
89
XCTAssertThrowsError ( try fh. read ( buffer, maxLength: bufferSize) )
87
90
}
You can’t perform that action at this time.
0 commit comments