Skip to content

Commit 9f4c0a1

Browse files
committed
Deduplicate skipped lines printing
1 parent 01f82f1 commit 9f4c0a1

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/diff.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl<'a> DiffState<'a> {
1818
match self.skipped_lines {
1919
0 => {}
2020
1 => eprintln!(" {}", self.last_skipped_line.unwrap()),
21-
_ => eprintln!("... {} lines skipped", self.skipped_lines),
21+
_ => eprintln!("... {} lines skipped ...", self.skipped_lines),
2222
}
2323
self.skipped_lines = 0;
2424
}
@@ -101,10 +101,8 @@ impl<'a> DiffState<'a> {
101101
}
102102
}
103103

104-
fn finish(self) {
105-
if self.skipped_lines != 0 {
106-
eprintln!("... {} lines skipped ...", self.skipped_lines);
107-
}
104+
fn finish(mut self) {
105+
self.print_skip();
108106
eprintln!()
109107
}
110108
}

tests/integrations/basic-fail/Cargo.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ tests/actual_tests/foomp.rs FAILED:
4040
command: "rustc" "--error-format=json" "--edition=2021" "--extern" "basic_fail=$DIR/$DIR/../../../target/debug/libbasic_fail-$HASH.rmeta" "-L" "$DIR/$DIR/../../../target/debug" "-L" "$DIR/$DIR/../../../target/debug" "tests/actual_tests/foomp.rs"
4141

4242
actual output differed from expected tests/actual_tests/foomp.stderr
43-
... 5 lines skipped
43+
... 5 lines skipped ...
4444
+ | |
4545
+ | arguments to this function are incorrect
46-
... 2 lines skipped
46+
... 2 lines skipped ...
4747
~ --> $DIR/$DIR/src/lib.rs:1:8
48-
... 2 lines skipped
48+
... 2 lines skipped ...
4949
~ | ^^^ some expected text that isn't in the actual message
5050

5151
-error: aborting doo to previous error

0 commit comments

Comments
 (0)