mirror of
https://github.com/unclebob/mutator.git
synced 2026-11-26 18:58:50 +00:00
crapper treats Tests, AppTests, and *Tests.swift as tests, but mutator only asked is_test_file about the filename. That kept a file such as Tests/DemoTests/Board.swift, so a run would mutate the test suite. .build, .swiftpm, and DerivedData were already SKIP_DIRS. A Swift path is now a test path when a directory component ends with Tests, or the file name ends with Tests.swift. A deeper directory named test, the Java fixture layout, is still mutated. Proved by the source walk and by selecting Sources/Demo/Box.swift next to Tests/DemoTests/Board.swift and BoxTests.swift. The walk failed first because those three Tests paths were still chosen. Both tests pass. Co-authored-by: Robert C. Martin <[email protected]>