Skip to content

Commit a653c20

Browse files
committed
Enhance some tests
1 parent 045b370 commit a653c20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tests/SimpleStreamTests/SimpleStreamTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class SimpleStreamTests : XCTestCase {
3333
let ds = SimpleDataStream(data: d)
3434
let rd = try ds.readData(upTo: [delim], matchingMode: .anyMatchWins, includeDelimiter: false).data
3535
XCTAssert(rd == Data(hexEncoded: "01 23")!)
36+
37+
let nx = try ds.readData(size: 1)
38+
XCTAssert(nx == Data(hexEncoded: "45")!)
3639
}
3740

3841
func testDataStreamReadToEnd() throws {
@@ -81,7 +84,7 @@ class SimpleStreamTests : XCTestCase {
8184
defer {buffer.deallocate()}
8285

8386
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 */
8588

8689
XCTAssertThrowsError(try fh.read(buffer, maxLength: bufferSize))
8790
}

0 commit comments

Comments
 (0)