File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ pub fn trim<S: AsRef<[u8]>>(output: S) -> String {
1313}
1414
1515pub 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
3033fn keep ( line : & str ) -> bool {
31- if line. trim_start ( ) . starts_with ( "--> ../../ " ) {
34+ if line. trim_start ( ) . starts_with ( "--> ../.." ) {
3235 return false ;
3336 }
3437
Original file line number Diff line number Diff 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 ( ( ) )
You can’t perform that action at this time.
0 commit comments