diff --git a/boa_tester/src/results.rs b/boa_tester/src/results.rs index 622a45682f..42929eba4b 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -250,7 +250,7 @@ pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) { fn pretty_int(i: isize) -> String { let mut res = String::new(); - for (idx, val) in i.to_string().chars().rev().enumerate() { + for (idx, val) in i.abs().to_string().chars().rev().enumerate() { if idx != 0 && idx % 3 == 0 { res.insert(0, ','); } @@ -264,7 +264,13 @@ pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) { format!( "{}{}{}{}", if diff == 0 { "" } else { "**" }, - if diff > 0 { "+" } else { "" }, + if diff.is_positive() { + "+" + } else if diff.is_negative() { + "-" + } else { + "" + }, pretty_int(diff), if diff == 0 { "" } else { "**" } )