Skip to content

Commit

Permalink
Change UI of --bless
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgolfouse committed Dec 19, 2024
1 parent 2b46405 commit 8b38ac4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions creusot/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,21 @@ where
}

if args.bless {
if !args.quiet {
out.set_color(ColorSpec::new().set_fg(Some(Color::Blue))).unwrap();
writeln!(&mut out, "blessed").unwrap();
out.reset().unwrap();
}
let (success, _) =
differ(output.clone(), &stdout, Some(&stderr), should_succeed, is_tty).unwrap();

if !success {
if success {
if is_tty {
// Move to beginning of line and clear line.
write!(out, "\x1b[G\x1b[2K").unwrap();
} else {
out.set_color(ColorSpec::new().set_fg(Some(Color::Green))).unwrap();
writeln!(out, "ok").unwrap();
}
} else {
write!(out, "{current}").unwrap();
out.set_color(ColorSpec::new().set_fg(Some(Color::Red))).unwrap();
writeln!(&mut out, "failure").unwrap();
out.set_color(ColorSpec::new().set_fg(Some(Color::Blue))).unwrap();
writeln!(&mut out, "blessed").unwrap();
out.reset().unwrap();
}

Expand Down

0 comments on commit 8b38ac4

Please sign in to comment.