Skip to content

Commit 7213002

Browse files
committed
Fixes test case TestNSFileManger.test_fileAttributes
Check only for the existence of file owner's account (user) identifier instead of comparing its numeric value because - user identifier of `0` are assigned to the superuser in linux - negative value are valid account identifier. e.g. `nobody` is `-2` (See https://en.wikipedia.org/wiki/User_identifier) - There's an assumption made here that account identifier are numeric which is reasonable for most system but there's a slim chance that this might not be the case. Thanks to @lxcid
1 parent 5893bfa commit 7213002

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TestFoundation/TestNSFileManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class TestNSFileManger : XCTestCase {
121121
XCTAssertEqual(fileType!, NSFileTypeRegular)
122122

123123
let fileOwnerAccountID = attrs[NSFileOwnerAccountID] as? NSNumber
124-
XCTAssertNotEqual(fileOwnerAccountID!.longLongValue, 0)
124+
XCTAssertNotNil(fileOwnerAccountID)
125125

126126
} catch let err {
127127
XCTFail("\(err)")

0 commit comments

Comments
 (0)