diff options
Diffstat (limited to 'crates/libsyntax2/tests/test')
-rw-r--r-- | crates/libsyntax2/tests/test/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/libsyntax2/tests/test/main.rs b/crates/libsyntax2/tests/test/main.rs index 6b0a44d0c..802dba0e9 100644 --- a/crates/libsyntax2/tests/test/main.rs +++ b/crates/libsyntax2/tests/test/main.rs | |||
@@ -70,19 +70,19 @@ fn assert_equal_text(expected: &str, actual: &str, path: &Path) { | |||
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | let dir = project_dir(); | 72 | let dir = project_dir(); |
73 | let path = path.strip_prefix(&dir).unwrap_or_else(|_| path); | 73 | let pretty_path = path.strip_prefix(&dir).unwrap_or_else(|_| path); |
74 | if expected.trim() == actual.trim() { | 74 | if expected.trim() == actual.trim() { |
75 | println!("whitespace difference, rewriting"); | 75 | println!("whitespace difference, rewriting"); |
76 | println!("file: {}\n", path.display()); | 76 | println!("file: {}\n", pretty_path.display()); |
77 | fs::write(path, actual).unwrap(); | 77 | fs::write(path, actual).unwrap(); |
78 | return; | 78 | return; |
79 | } | 79 | } |
80 | if REWRITE { | 80 | if REWRITE { |
81 | println!("rewriting {}", path.display()); | 81 | println!("rewriting {}", pretty_path.display()); |
82 | fs::write(path, actual).unwrap(); | 82 | fs::write(path, actual).unwrap(); |
83 | return; | 83 | return; |
84 | } | 84 | } |
85 | assert_eq_text!(expected, actual, "file: {}", path.display()); | 85 | assert_eq_text!(expected, actual, "file: {}", pretty_path.display()); |
86 | } | 86 | } |
87 | 87 | ||
88 | fn collect_tests(paths: &[&str]) -> Vec<PathBuf> { | 88 | fn collect_tests(paths: &[&str]) -> Vec<PathBuf> { |