Skip to content

Commit 7526868

Browse files
committed
Tweaks for windows support
1 parent c867084 commit 7526868

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test-runner/src/normalize.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ pub fn trim<S: AsRef<[u8]>>(output: S) -> String {
1313
}
1414

1515
pub fn diagnostics(output: Vec<u8>) -> String {
16+
let mut from_bytes = String::from_utf8_lossy(&output).to_string();
17+
from_bytes = from_bytes.replace("\r\n", "\n");
18+
1619
let mut normalized = String::new();
1720

18-
for line in String::from_utf8_lossy(&output).to_string().lines() {
21+
for line in from_bytes.lines() {
1922
if keep(line) {
2023
normalized += line;
2124
if !normalized.ends_with("\n\n") {
@@ -28,7 +31,7 @@ pub fn diagnostics(output: Vec<u8>) -> String {
2831
}
2932

3033
fn keep(line: &str) -> bool {
31-
if line.trim_start().starts_with("--> ../../") {
34+
if line.trim_start().starts_with("--> ../..") {
3235
return false;
3336
}
3437

test-runner/src/run.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ impl Test {
188188
return Ok(());
189189
}
190190

191-
let expected = fs::read_to_string(stderr_path).map_err(Error::ReadStderr)?;
191+
let expected = fs::read_to_string(stderr_path)
192+
.map_err(Error::ReadStderr)?
193+
.replace("\r\n", "\n");
194+
192195
if expected == stderr {
193196
message::nice();
194197
Ok(())

0 commit comments

Comments
 (0)