Skip to content

Commit

Permalink
color
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchen committed Sep 24, 2024
1 parent ded9894 commit 0da1f11
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
31 changes: 29 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/moonbuild/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ semver.workspace = true
chrono.workspace = true
zip.workspace = true
thiserror.workspace = true
json-structural-diff = "0.1.0"
json-structural-diff = { version = "0.1.0", features = ["colorize"] }

[dev-dependencies]
expect-test.workspace = true
5 changes: 4 additions & 1 deletion crates/moonbuild/src/expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,10 @@ pub fn render_expect_fail(msg: &str) -> anyhow::Result<()> {
&serde_json_lenient::from_str(&rep.actual)?,
false,
);
dbg!(diffs.diff);
if let Some(diff) = diffs.diff {
let diffs = json_structural_diff::colorize(&diff, true);
println!("{}", diffs);
}
return Ok(());
}

Expand Down

0 comments on commit 0da1f11

Please sign in to comment.