Skip to content

Commit 707061f

Browse files
committed
fixed nested test with explanatory comment
1 parent c9a14e3 commit 707061f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Tests/SwiftFormatTests/Core/IgnoreFileTests.swift

+11-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,17 @@ final class IgnoreFileTests: XCTestCase {
118118
XCTAssertNotNil(try IgnoreFile(for: url.appending(path: "Source/Ignored/file.swift")))
119119
let iterator = FileIterator(urls: [url], followSymlinks: false)
120120
let files = Array(iterator)
121-
print(files)
122-
XCTAssertEqual(files.count, 1)
123-
XCTAssertEqual(files.first?.lastPathComponent, "file.swift")
121+
122+
// note that the ignore file has no effect on the FileIterator here,
123+
// because it is not in the root directory
124+
// this is expected behavior, and a limitation of the current implementation
125+
// of FileIterator, as it flattens subdirectories into a single list rather
126+
// than recursing into them; however, the ignore file itself will still be
127+
// picked up and obeyed when each source file is processed.
128+
XCTAssertEqual(files.count, 2)
129+
for file in files {
130+
XCTAssertEqual(file.lastPathComponent, "file.swift")
131+
}
124132
}
125133

126134
}

0 commit comments

Comments
 (0)