Show which reference image was updated (#3008)

This commit is contained in:
PgBiel 2023-12-19 06:19:20 -03:00 committed by GitHub
parent 6808e58a3b
commit c361566cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -498,7 +498,9 @@ fn test(
stdout.write_all(name.to_string_lossy().as_bytes()).unwrap();
if ok {
writeln!(stdout, "").unwrap();
if stdout.is_terminal() {
// Don't clear the line when the reference image was updated, to
// show in the output which test had its image updated.
if !updated && stdout.is_terminal() {
// ANSI escape codes: cursor moves up and clears the line.
write!(stdout, "\x1b[1A\x1b[2K").unwrap();
}