mirror of
https://github.com/apple/swift.git
synced 2026-10-06 12:37:28 +02:00
Extract the path-sanitization core (path normalization, shared argument definitions, replacement loop, and runtime-warning suppression) into a new swift_path_sanitize module so that both PathSanitizingFileCheck and a new PathSanitizingDiff front-end can share it. PathSanitizingDiff sanitizes stdin the same way and then compares the result against a reference file using diff, collapsing the `PathSanitizingFileCheck --dry-run > out; diff out expected` pattern into a single step (exposed as the %PathSanitizingDiff lit substitution). Similar to PathSanitizingFileCheck, PathSanitizingDiff takes input on stdin, a positional file argument (which is the reference file, instead of file to check for CHECK directives), and various sanitize options. Like diff, PathSanitizingDiff tests can be automatically updated to match the current behavior using lit's `--update-tests`, thanks to the accompanying lit plugin. Migrates a swiftify-import test to demonstrate the new form.
4 lines
51 B
Plaintext
4 lines
51 B
Plaintext
// Preserved header.
|
|
//--- out.expected
|
|
stale line
|