File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Tests/SwiftFormatTests/Core Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments