difftreelog
test re-enable structural matching
in: master
4 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -283,12 +283,6 @@
]
[[package]]
-name = "difflib"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
-
-[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -807,17 +801,6 @@
dependencies = [
"once_cell",
"wasm-bindgen",
-]
-
-[[package]]
-name = "json-structural-diff"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e878e36a8a44c158505c2c818abdc1350413ad83dcb774a0459f6a7ef2b65cbf"
-dependencies = [
- "difflib",
- "regex",
- "serde_json",
]
[[package]]
@@ -1448,7 +1431,6 @@
"jrsonnet-evaluator",
"jrsonnet-gcmodule",
"jrsonnet-stdlib",
- "json-structural-diff",
"serde",
"serde_json",
]
Cargo.tomldiffbeforeafterboth1[workspace]2members = ["crates/*", "bindings/jsonnet", "cmds/*", "tests", "xtask"]3default-members = ["cmds/jrsonnet"]4resolver = "2"56[workspace.package]7authors = ["Yaroslav Bolyukin <iam@lach.pw>"]8edition = "2021"9license = "MIT"10repository = "https://github.com/CertainLach/jrsonnet"11version = "0.5.0-pre97"1213[workspace.dependencies]14jrsonnet-evaluator = { path = "./crates/jrsonnet-evaluator", version = "0.5.0-pre97" }15jrsonnet-macros = { path = "./crates/jrsonnet-macros", version = "0.5.0-pre97" }16jrsonnet-ir = { path = "./crates/jrsonnet-ir", version = "0.5.0-pre97" }17jrsonnet-ir-parser = { path = "./crates/jrsonnet-ir-parser", version = "0.5.0-pre97" }18jrsonnet-peg-parser = { path = "./crates/jrsonnet-peg-parser", version = "0.5.0-pre97" }19jrsonnet-rowan-parser = { path = "./crates/jrsonnet-rowan-parser", version = "0.5.0-pre97" }20jrsonnet-interner = { path = "./crates/jrsonnet-interner", version = "0.5.0-pre97" }21jrsonnet-stdlib = { path = "./crates/jrsonnet-stdlib", version = "0.5.0-pre97" }22jrsonnet-cli = { path = "./crates/jrsonnet-cli", version = "0.5.0-pre97" }23jrsonnet-types = { path = "./crates/jrsonnet-types", version = "0.5.0-pre97" }24jrsonnet-formatter = { path = "./crates/jrsonnet-formatter", version = "0.5.0-pre97" }25jrsonnet-gcmodule = { version = "0.4.2" }26# Diagnostics.27# hi-doc is my library, which handles text formatting very well, but isn't polished enough yet28# Previous implementation was based on annotate-snippets, which I don't like for many reasons.29#30# I'm against using miette, because I want to reuse data between interpreter and annotations, yet miette31# and other libraries want to handle spans etc by itself, which is okay for compiler diagnostics, but is32# bad for interpreter, where interpreter and parser are paired much closer.33hi-doc = "0.3.0"34annotate-snippets = "0.12.11"3536# CLI37clap = "4.5"38clap_complete = "4.5"3940# Parsing, manifestification is implemented manually everywhere41serde = "1.0.228"42serde_json = "1.0.149"43serde-saphyr = { version = "0.0.17", default-features = false }4445# Error handling46anyhow = "1.0.101"47thiserror = "2.0.18"4849# Code formatting50dprint-core = "0.67.4"5152# Stdlib hashing functions53md5 = "0.8.0"54sha1 = "0.10.6"55sha2 = "0.10.9"56sha3 = "0.10.8"5758# Source code parsing.59# Jrsonnet has two parsers for jsonnet - one is for execution, and another is for better parsing diagnostics/lints/LSP.60# First (and fast one) is based on peg, second is based on rowan.61peg = "0.8.5"62logos = "0.16.1"63ungrammar = "1.16.1"64rowan = "0.16.1"6566mimallocator = "0.1.3"67indoc = "2.0"68insta = { version = "1.46", features = ["glob"] }69tempfile = "3.24"70pathdiff = "0.2.3"71hashbrown = "0.16.1"72static_assertions = "1.1"73rustc-hash = "2.1"74num-bigint = "0.4.6"75strsim = "0.11.1"76proc-macro2 = "1.0"77quote = "1.0"78syn = "2.0"79drop_bomb = "0.1.5"80base64 = "0.22.1"81indexmap = "2.13.0"82itertools = "0.14.0"83xshell = "0.2.7"8485regex = "1.12"86lru = "0.16.3"8788json-structural-diff = "0.2.0"89syn-dissect-closure = "0.1.0"9091[workspace.lints.rust]92unsafe_op_in_unsafe_fn = "deny"9394# TODO: add docs everywhere95# missing_doc = "warn"9697elided_lifetimes_in_paths = "allow"98explicit_outlives_requirements = "allow"99noop_method_call = "allow"100single_use_lifetimes = "allow"101variant_size_differences = "allow"102macro_expanded_macro_exports_accessed_by_absolute_paths = "allow"103104[workspace.lints.rustdoc]105all = "warn"106107[workspace.lints.clippy]108all = { level = "warn", priority = -1 }109nursery = { level = "warn", priority = -1 }110pedantic = { level = "warn", priority = -1 }111112ptr_arg = "allow"113# Too verbose114must_use_candidate = "allow"115# A lot of functions pass around errors thrown by code116missing_errors_doc = "allow"117# A lot of pointers have interior Rc118needless_pass_by_value = "allow"119# Its fine120wildcard_imports = "allow"121enum_glob_use = "allow"122module_name_repetitions = "allow"123# TODO: fix individual issues, however this works as intended almost everywhere124cast_precision_loss = "allow"125cast_possible_wrap = "allow"126cast_possible_truncation = "allow"127cast_sign_loss = "allow"128# False positives129# https://github.com/rust-lang/rust-clippy/issues/6902130use_self = "allow"131# https://github.com/rust-lang/rust-clippy/issues/8539132iter_with_drain = "allow"133type_repetition_in_bounds = "allow"134# ci is being run with nightly, but library should work on stable135missing_const_for_fn = "allow"136# too many false-positives with .expect() calls137missing_panics_doc = "allow"138# false positive for IStr type. There is an configuration option for139# such cases, but it doesn't work:140# https://github.com/rust-lang/rust-clippy/issues/9801141mutable_key_type = "allow"142# false positives143redundant_pub_crate = "allow"144# Sometimes code is fancier without that145manual_let_else = "allow"146# Something is broken about that lint, can't be allowed for147# codegenerated-stdlib block148similar_names = "allow"149150#[profile.test]151#opt-level = 1152153[profile.release]154opt-level = 3155lto = "fat"156codegen-units = 1157debug = 0158panic = "abort"159strip = true160161[profile.releasedebug]162inherits = "release"163debug = 2164panic = "unwind"165strip = falsetests/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]
tests/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()
);