diff options
author | Aleksey Kladov <[email protected]> | 2018-08-16 10:51:40 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-16 10:51:40 +0100 |
commit | 7094291573dc819e3115950ec3b2316bd5e9ea33 (patch) | |
tree | be18ef6c5baab68acac484d00277125484d15820 /crates/libsyntax2/tests/test | |
parent | 1193c5f829dc96683132c12d5395d7805787af2a (diff) |
tt-attrs
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> { |