From daebd04922cd5ed072ada621784069cf6480c2de Mon Sep 17 00:00:00 2001 From: Johnny Graettinger Date: Fri, 12 Apr 2024 21:32:23 +0000 Subject: [PATCH] insta::assert_display_snapshot() => insta::assert_snapshot() --- crates/agent/src/discovers/specs.rs | 2 +- crates/derive-sqlite/src/dbutil.rs | 4 +- crates/derive-sqlite/src/param.rs | 8 +-- .../derive-typescript/src/codegen/mapper.rs | 2 +- crates/proto-flow/tests/regression.rs | 60 +++++++++---------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/crates/agent/src/discovers/specs.rs b/crates/agent/src/discovers/specs.rs index 005aed0c10..29ed29b888 100644 --- a/crates/agent/src/discovers/specs.rs +++ b/crates/agent/src/discovers/specs.rs @@ -413,7 +413,7 @@ mod tests { let out = super::merge_collections(discovered_bindings, fetched_collections, targets); - insta::assert_display_snapshot!(serde_json::to_string_pretty(&out).unwrap()); + insta::assert_snapshot!(serde_json::to_string_pretty(&out).unwrap()); } #[test] diff --git a/crates/derive-sqlite/src/dbutil.rs b/crates/derive-sqlite/src/dbutil.rs index 935a32032f..53a0366d37 100644 --- a/crates/derive-sqlite/src/dbutil.rs +++ b/crates/derive-sqlite/src/dbutil.rs @@ -327,7 +327,7 @@ mod test { |row| row.get(0), ) .unwrap(); - insta::assert_display_snapshot!(fixture_content, @r###"[{"id":4,"value":"hello"},{"id":5,"value":"updated"},{"thing":"hi","other":32},{"thing":"there","other":32},{"thing":"bye","other":42}]"###); + insta::assert_snapshot!(fixture_content, @r###"[{"id":4,"value":"hello"},{"id":5,"value":"updated"},{"thing":"hi","other":32},{"thing":"there","other":32},{"thing":"bye","other":42}]"###); } #[test] @@ -377,6 +377,6 @@ mod test { ] "###); - insta::assert_display_snapshot!(sql_block_to_statements("select 1; \0 select 2;").unwrap_err(), @"SQL block contains illegal NULL characters"); + insta::assert_snapshot!(sql_block_to_statements("select 1; \0 select 2;").unwrap_err(), @"SQL block contains illegal NULL characters"); } } diff --git a/crates/derive-sqlite/src/param.rs b/crates/derive-sqlite/src/param.rs index 2e15e16047..981ff7b979 100644 --- a/crates/derive-sqlite/src/param.rs +++ b/crates/derive-sqlite/src/param.rs @@ -148,19 +148,19 @@ mod test { ); } - insta::assert_display_snapshot!( + insta::assert_snapshot!( Param::resolve("$simplee", ¶ms).unwrap_err(), @"parameter $simplee not found: did you mean $Simple ?"); - insta::assert_display_snapshot!( + insta::assert_snapshot!( Param::resolve("$with$nesting", ¶ms).unwrap_err(), @"parameter $with$nesting not found: did you mean $With$Nesting ?"); - insta::assert_display_snapshot!( + insta::assert_snapshot!( Param::resolve("$With$Nesting$and_special_hyphen", ¶ms).unwrap_err(), @"parameter $With$Nesting$and_special_hyphen not found: did you mean $p::(With/Nesting/and+special-hyphen) ?"); - insta::assert_display_snapshot!( + insta::assert_snapshot!( Param::resolve("$way_off", ¶ms).unwrap_err(), @"parameter $way_off not found: did you mean $Simple ?"); } diff --git a/crates/derive-typescript/src/codegen/mapper.rs b/crates/derive-typescript/src/codegen/mapper.rs index cfcbd91572..48d44b6a7b 100644 --- a/crates/derive-typescript/src/codegen/mapper.rs +++ b/crates/derive-typescript/src/codegen/mapper.rs @@ -306,6 +306,6 @@ mod test { w.push_str("\n\n"); } - insta::assert_display_snapshot!(w); + insta::assert_snapshot!(w); } } diff --git a/crates/proto-flow/tests/regression.rs b/crates/proto-flow/tests/regression.rs index cff1dd66ed..2d127ba0f8 100644 --- a/crates/proto-flow/tests/regression.rs +++ b/crates/proto-flow/tests/regression.rs @@ -804,179 +804,179 @@ fn proto_test(msg: M) #[test] fn test_collection_spec_json() { let msg = ex_collection_spec(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_collection_spec_proto() { let msg = ex_collection_spec(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_capture_spec_json() { let msg = ex_capture_spec(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_capture_spec_proto() { let msg = ex_capture_spec(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_derivation_spec_json() { let msg = ex_derivation_spec(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_derivation_spec_proto() { let msg = ex_derivation_spec(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_materialization_spec_json() { let msg = ex_materialization_spec(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_materialization_spec_proto() { let msg = ex_materialization_spec(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_test_spec_json() { let msg = ex_test_spec(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_test_spec_proto() { let msg = ex_test_spec(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_oauth2_json() { let msg = ex_oauth2(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_oauth2_proto() { let msg = ex_oauth2(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_shard_labeling_json() { let msg = ex_shard_labeling(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_shard_labeling_proto() { let msg = ex_shard_labeling(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_log_json() { let msg = ex_log(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_log_proto() { let msg = ex_log(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_stats_json() { let msg = ex_stats(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_stats_proto() { let msg = ex_stats(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_capture_request_json() { let msg = ex_capture_request(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_capture_request_proto() { let msg = ex_capture_request(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_capture_response_json() { let msg = ex_capture_response(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_capture_response_proto() { let msg = ex_capture_response(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_derive_request_json() { let msg = ex_derive_request(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_derive_request_proto() { let msg = ex_derive_request(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_derive_response_json() { let msg = ex_derive_response(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_derive_response_proto() { let msg = ex_derive_response(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_materialize_request_json() { let msg = ex_materialize_request(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_materialize_request_proto() { let msg = ex_materialize_request(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); } #[test] fn test_materialize_response_json() { let msg = ex_materialize_response(); - insta::assert_display_snapshot!(json_test(msg)); + insta::assert_snapshot!(json_test(msg)); } #[test] fn test_materialize_response_proto() { let msg = ex_materialize_response(); - insta::assert_display_snapshot!(proto_test(msg)); + insta::assert_snapshot!(proto_test(msg)); }