Skip to content

Commit

Permalink
fixed nested test with explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Dec 11, 2024
1 parent c9a14e3 commit 707061f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Tests/SwiftFormatTests/Core/IgnoreFileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,17 @@ final class IgnoreFileTests: XCTestCase {
XCTAssertNotNil(try IgnoreFile(for: url.appending(path: "Source/Ignored/file.swift")))
let iterator = FileIterator(urls: [url], followSymlinks: false)
let files = Array(iterator)
print(files)
XCTAssertEqual(files.count, 1)
XCTAssertEqual(files.first?.lastPathComponent, "file.swift")

// note that the ignore file has no effect on the FileIterator here,
// because it is not in the root directory
// this is expected behavior, and a limitation of the current implementation
// of FileIterator, as it flattens subdirectories into a single list rather
// than recursing into them; however, the ignore file itself will still be
// picked up and obeyed when each source file is processed.
XCTAssertEqual(files.count, 2)
for file in files {
XCTAssertEqual(file.lastPathComponent, "file.swift")
}
}

}

0 comments on commit 707061f

Please sign in to comment.