Skip to content

Commit 5505996

Browse files
committed
Feedback
1 parent a7b384b commit 5505996

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,18 +1079,15 @@ private struct FileManagerTests {
10791079
throw error
10801080
}
10811081

1082-
guard
1083-
let linkAttrs = try? fileManager.attributesOfItem(atPath: "link"),
1084-
let targetAttrs = try? fileManager.attributesOfItem(atPath: "target")
1085-
else { return }
1082+
let linkAttrs = try fileManager.attributesOfItem(atPath: "link")
1083+
let targetAttrs = try fileManager.attributesOfItem(atPath: "target")
10861084

10871085
let linkXattrs = linkAttrs[xattrKey] as? [String: Data]
10881086
let targetXattrs = targetAttrs[xattrKey] as? [String: Data]
10891087

1090-
// If neither reports xattrs, treat as unsupported on this FS/runtime.
1091-
if linkXattrs == nil && targetXattrs == nil {
1092-
return
1093-
}
1088+
#require(
1089+
linkXattrs != nil || targetXattrs != nil,
1090+
"Expected extended attributes after successful setAttributes call")
10941091

10951092
// Prefer the symlink to carry the xattr; if the FS follows symlinks, accept target instead.
10961093
if let linkXattrs {

0 commit comments

Comments
 (0)