Skip to content

Commit 89f2c43

Browse files
committed
Convert line endings when doing exact pretty-print testing
For the benefit of windows
1 parent 4ae6c83 commit 89f2c43

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/compiletest/runtest.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ fn run_pretty_test(cx: &cx, props: &test_props, testfile: &str) {
113113
}
114114
};
115115
let actual = srcs.(ivec::len(srcs) - 1u);
116+
117+
if option::is_some(props.pp_exact) {
118+
// Now we have to care about line endings
119+
let cr = "\r";
120+
check str::is_not_empty(cr);
121+
actual = str::replace(actual, cr, "");
122+
expected = str::replace(expected, cr, "");
123+
}
116124

117125
compare_source(expected, actual);
118126

0 commit comments

Comments
 (0)