Skip to content

Commit 73bfce2

Browse files
authored
Enhance FileManager.attributesOfItem(atPath:) Test
Added FileAttributeKey.ownerAccountName & FileAttributeKey.groupOwnerAccountName result tests
1 parent ca7ff8f commit 73bfce2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

TestFoundation/TestNSFileManager.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,23 @@ class TestNSFileManager : XCTestCase {
151151
let fileOwnerAccountID = attrs[.ownerAccountID] as? NSNumber
152152
XCTAssertNotNil(fileOwnerAccountID)
153153

154+
let fileGroupOwnerAccountID = attrs[.groupOwnerAccountID] as? NSNumber
155+
XCTAssertNotNil(fileGroupOwnerAccountID)
156+
157+
if let fileOwnerAccountName = attrs[.ownerAccountName] {
158+
XCTAssertNotNil(fileOwnerAccountName as? String)
159+
if let fileOwnerAccountNameStr = fileOwnerAccountName as? String {
160+
XCTAssertFalse(fileOwnerAccountNameStr.isEmpty)
161+
}
162+
}
163+
164+
if let fileGroupOwnerAccountName = attrs[.groupOwnerAccountName] {
165+
XCTAssertNotNil(fileGroupOwnerAccountName as? String)
166+
if let fileGroupOwnerAccountNameStr = fileGroupOwnerAccountName as? String {
167+
XCTAssertFalse(fileGroupOwnerAccountNameStr.isEmpty)
168+
}
169+
}
170+
154171
} catch let err {
155172
XCTFail("\(err)")
156173
}

0 commit comments

Comments
 (0)