@@ -281,10 +281,11 @@ class TestFileHandle : XCTestCase {
281
281
" \( FileHandle . readCompletionNotification. rawValue) is not equal to NSFileHandleReadCompletionNotification " )
282
282
}
283
283
284
+ #if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
284
285
func test_nullDevice( ) {
285
286
let fh = FileHandle . nullDevice
286
287
287
- XCTAssertEqual ( fh. fileDescriptor , - 1 )
288
+ XCTAssertFalse ( fh. _isPlatformHandleValid )
288
289
fh. closeFile ( )
289
290
fh. seek ( toFileOffset: 10 )
290
291
XCTAssertEqual ( fh. offsetInFile, 0 )
@@ -299,6 +300,7 @@ class TestFileHandle : XCTestCase {
299
300
fh. seek ( toFileOffset: 0 )
300
301
XCTAssertEqual ( fh. readDataToEndOfFile ( ) . count, 0 )
301
302
}
303
+ #endif
302
304
303
305
func test_truncateFile( ) {
304
306
let url : URL = URL ( fileURLWithPath: NSTemporaryDirectory ( ) ) . appendingPathComponent ( ProcessInfo . processInfo. globallyUniqueString, isDirectory: false )
@@ -494,7 +496,6 @@ class TestFileHandle : XCTestCase {
494
496
( " testWritingWithBuffer " , testWritingWithBuffer) ,
495
497
( " testWritingWithMultiregionData " , testWritingWithMultiregionData) ,
496
498
( " test_constants " , test_constants) ,
497
- ( " test_nullDevice " , test_nullDevice) ,
498
499
( " test_truncateFile " , test_truncateFile) ,
499
500
( " test_readabilityHandlerCloseFileRace " , test_readabilityHandlerCloseFileRace) ,
500
501
( " test_readabilityHandlerCloseFileRaceWithError " , test_readabilityHandlerCloseFileRaceWithError) ,
@@ -509,6 +510,7 @@ class TestFileHandle : XCTestCase {
509
510
510
511
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
511
512
tests. append ( contentsOf: [
513
+ ( " test_nullDevice " , test_nullDevice) ,
512
514
( " testHandleCreationAndCleanup " , testHandleCreationAndCleanup) ,
513
515
( " testOffset " , testOffset) ,
514
516
] )
0 commit comments