git.delta.rocks / jrsonnet / refs/commits / 7da68eaa8a4d

difftreelog

test re-enable structural matching

yzxkunvxYaroslav Bolyukin2026-03-23parent: #3a37893.patch.diff
in: master

4 files changed

modifiedCargo.lockdiffbeforeafterboth
after · Cargo.lock
193 packageslockfile v4
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -85,7 +85,6 @@
 regex = "1.12"
 lru = "0.16.3"
 
-json-structural-diff = "0.2.0"
 syn-dissect-closure = "0.1.0"
 
 [workspace.lints.rust]
modifiedtests/Cargo.tomldiffbeforeafterboth
--- a/tests/Cargo.toml
+++ b/tests/Cargo.toml
@@ -19,7 +19,6 @@
 jrsonnet-gcmodule.workspace = true
 jrsonnet-stdlib.workspace = true
 serde.workspace = true
-json-structural-diff.workspace = true
 serde_json.workspace = true
 
 [dev-dependencies]
modifiedtests/tests/cpp_test_suite.rsdiffbeforeafterboth
--- a/tests/tests/cpp_test_suite.rs
+++ b/tests/tests/cpp_test_suite.rs
@@ -144,31 +144,6 @@
 	"pow6.jsonnet",
 	// golang escapes "e" yaml key, does it think it is float?
 	"builtin_manifestYamlDoc.jsonnet",
-	// Wtf?..
-	// Result
-	// [
-	//   {},
-	//   {},
-	//   []
-	// ]
-	// and golden
-	// [
-	//   {},
-	//   {},
-	//   []
-	// ]
-	// did not match structurally:
-	//  [
-	//    ...
-	// -  {
-	// -  }
-	// +  {
-	// +  }
-	//    [
-	//    ]
-	//  ]
-	"empty_object_comp.jsonnet",
-	"object_hidden.jsonnet",
 	// multi output is a CLI part, not an interpreter.
 	"multi.jsonnet",
 	"multi_no_newline.jsonnet",
@@ -183,9 +158,6 @@
 	"number_leading_zero.jsonnet",
 	// Jrsonnet has this overload
 	"number_times_string.jsonnet",
-	// Jrsonnet has stricter implementations, this is a dumb thing that the filter value might not be
-	// evaluated anyway...
-	"std.filter7.jsonnet",
 	// Golang fails with max stack frames exceeded error
 	"std.makeArray_recursive_evalutation_order_matters.jsonnet",
 	// Jrsonnet has this overload
@@ -196,8 +168,6 @@
 
 #[test]
 fn cpp_test_suite() -> io::Result<()> {
-	use json_structural_diff::JsonDiff;
-
 	for root_dir in ["cpp_test_suite", "go_testdata"] {
 		let root_tests = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
 		let root = root_tests.join(root_dir);
@@ -261,7 +231,7 @@
 		#[cfg(not(feature = "ir-parser"))]
 		let update_golden_path = &golden_override;
 
-		match (serde_json::from_str(&result), serde_json::from_str(&golden)) {
+		match (serde_json::from_str::<serde_json::Value>(&result), serde_json::from_str::<serde_json::Value>(&golden)) {
 			(Err(_), Ok(_)) => panic!(
 				"unexpected error for golden {}:\n<got>\n{result}\n</got>\n<golden>\n{golden}\n</golden>",
 				entry.path().display()
@@ -270,17 +240,15 @@
 				"expected error for golden {}:\n<got>\n{result}\n</got>\n<golden>\n{golden}\n</golden>",
 				entry.path().display()
 			),
-			(Ok(result_v), Ok(golden)) => {
-				// Show diff relative to golden`.
-				let diff = JsonDiff::diff_string(&golden, &result_v, false);
-				if let Some(diff) = diff {
+			(Ok(result_v), Ok(golden_v)) => {
+				if result_v != golden_v {
 					if env::var_os("UPDATE_GOLDEN").is_some() {
 						fs::write(update_golden_path, result)?;
 					} else {
 						panic!(
 							"Result \n{result_v:#}\n\
-								and golden \n{golden:#}\n\
-								did not match structurally:\n{diff:#}\n\
+								and golden \n{golden_v:#}\n\
+								did not match structurally\n\
 								for golden {}",
 							entry.path().display()
 						);