Skip to content

Commit

Permalink
Make tera_templates_are_in_sync print a diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Feb 22, 2025
1 parent cc692bb commit 55b7c3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rust-tooling/Cargo.lock

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

1 change: 1 addition & 0 deletions rust-tooling/generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ panic = "warn"
anyhow = "1.0.81"
clap = { version = "4.4.8", features = ["derive"] }
convert_case = "0.6.0"
difference = "2.0.0"
glob = "0.3.1"
inquire = "0.6.2"
models = { version = "0.1.0", path = "../models" }
Expand Down
2 changes: 2 additions & 0 deletions rust-tooling/generate/tests/tera_templates_are_in_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ fn tera_templates_are_in_sync() {
let on_disk = std::fs::read_to_string(test_path).unwrap();

if generated.tests != on_disk {
let diff = difference::Changeset::new(&on_disk, &generated.tests, "");
println!("{diff}");
panic!(
"
The Tera template for exercise '{slug}' is not in sync.
Expand Down

0 comments on commit 55b7c3a

Please sign in to comment.