From 5ab9f4093f6d62d8889918a8a84c99b386f1c816 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 5 Mar 2022 00:47:06 +0100 Subject: [PATCH] Remove assertion_line from stored snapshots (#218) --- CHANGELOG.md | 1 + cargo-insta/src/cargo.rs | 4 ++- src/runtime.rs | 2 +- src/snapshot.rs | 27 +++++++++++++++++-- src/snapshots/insta__test__embedded.snap | 1 - .../snapshot_no_module_prepending.snap | 1 - tests/snapshots/test_basic__debug_vector.snap | 1 - tests/snapshots/test_basic__display.snap | 1 - tests/snapshots/test_basic__json_vector.snap | 1 - .../test_basic__nested__nested_module.snap | 1 - .../test_basic__unnamed_debug_vector-2.snap | 1 - .../test_basic__unnamed_debug_vector-3.snap | 1 - .../test_basic__unnamed_debug_vector.snap | 1 - .../test_basic__unnamed_display-2.snap | 1 - .../test_basic__unnamed_display.snap | 1 - .../test_basic__unnamed_json_vector-2.snap | 1 - .../test_basic__unnamed_json_vector-3.snap | 1 - .../test_basic__unnamed_json_vector.snap | 1 - .../test_basic__unnamed_nested_closure.snap | 1 - .../test_basic__unnamed_yaml_vector-2.snap | 1 - .../test_basic__unnamed_yaml_vector-3.snap | 1 - .../test_basic__unnamed_yaml_vector.snap | 1 - tests/snapshots/test_basic__yaml_vector.snap | 1 - tests/snapshots/test_bugs__crlf.snap | 1 - tests/snapshots/test_bugs__trailing_crlf.snap | 1 - ...test_glob__basic_globbing@goodbye.txt.snap | 1 - .../test_glob__basic_globbing@hello.txt.snap | 1 - ..._glob__globs_follow_links@goodbye.txt.snap | 1 - ...st_glob__globs_follow_links@hello.txt.snap | 1 - .../test_inline__unnamed_single_line-2.snap | 1 - .../test_inline__unnamed_single_line.snap | 1 - ..._inline__unnamed_thread_single_line-2.snap | 1 - ...st_inline__unnamed_thread_single_line.snap | 1 - tests/snapshots/test_redaction__foo_bar.snap | 1 - .../test_redaction__foo_bar_alt.snap | 1 - .../test_redaction__foo_bar_deep.snap | 1 - .../test_redaction__foo_bar_full_range.snap | 1 - .../test_redaction__foo_bar_range.snap | 1 - .../test_redaction__foo_bar_range_from.snap | 1 - .../test_redaction__foo_bar_range_to.snap | 1 - .../test_redaction__map_key_redaction.snap | 1 - ...est_redaction__struct_array_redaction.snap | 1 - tests/snapshots/test_redaction__user.snap | 1 - tests/snapshots/test_redaction__user_csv.snap | 1 - .../snapshots/test_redaction__user_json.snap | 1 - .../test_redaction__user_json_flags.snap | 1 - .../test_redaction__user_json_flags_alt.snap | 1 - .../test_redaction__user_json_settings.snap | 1 - ...edaction__user_json_settings_callback.snap | 1 - tests/snapshots/test_redaction__user_ron.snap | 1 - .../snapshots/test_redaction__user_toml.snap | 1 - ...ion__with_random_value_json_settings2.snap | 1 - .../test_suffixes__basic_suffixes@1.snap | 1 - .../test_suffixes__basic_suffixes@2.snap | 1 - .../test_suffixes__basic_suffixes@3.snap | 1 - .../test_settings__snapshot_path.snap | 1 - 56 files changed, 30 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1622928..9e8fbafc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to insta and cargo-insta are documented here. ## 1.13.0 - Fixed a bug where an extra newline was emitted following the snapshot header. +- `assertion_line` is no longer retained in snapshots. (#218) ## 1.12.0 diff --git a/cargo-insta/src/cargo.rs b/cargo-insta/src/cargo.rs index 8ca6a7fb..3c0c9012 100644 --- a/cargo-insta/src/cargo.rs +++ b/cargo-insta/src/cargo.rs @@ -221,7 +221,9 @@ impl SnapshotContainer { for snapshot in self.snapshots.iter() { match snapshot.op { Operation::Accept => { - fs::rename(&self.snapshot_path, &self.target_path)?; + let snapshot = Snapshot::from_file(&self.snapshot_path)?; + snapshot.save(&self.target_path)?; + fs::remove_file(&self.snapshot_path)?; } Operation::Reject => { fs::remove_file(&self.snapshot_path)?; diff --git a/src/runtime.rs b/src/runtime.rs index 151c4776..b3a75aa7 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -328,7 +328,7 @@ impl<'a> SnapshotAssertionContext<'a> { if let Some(ref snapshot_file) = self.snapshot_file { let mut new_path = snapshot_file.to_path_buf(); new_path.set_extension("snap.new"); - new_snapshot.save(&new_path)?; + new_snapshot.save_new(&new_path)?; if should_print { elog!( "{} {}", diff --git a/src/snapshot.rs b/src/snapshot.rs index 987909c2..bbee2dc0 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -267,18 +267,41 @@ impl Snapshot { &self.snapshot.0 } - pub(crate) fn save>(&self, path: P) -> Result<(), Box> { + fn save_with_metadata>( + &self, + path: P, + md: &MetaData, + ) -> Result<(), Box> { let path = path.as_ref(); if let Some(folder) = path.parent() { fs::create_dir_all(&folder)?; } let mut f = fs::File::create(&path)?; - serde_yaml::to_writer(&mut f, &self.metadata)?; + serde_yaml::to_writer(&mut f, md)?; f.write_all(b"---\n")?; f.write_all(self.contents_str().as_bytes())?; f.write_all(b"\n")?; Ok(()) } + + /// Saves the snapshot. + #[doc(hidden)] + pub fn save>(&self, path: P) -> Result<(), Box> { + // we do not want to retain the assertion line on the metadata when storing + // as a regular snapshot. + if self.metadata.assertion_line.is_some() { + let mut metadata = self.metadata.clone(); + metadata.assertion_line = None; + self.save_with_metadata(path, &metadata) + } else { + self.save_with_metadata(path, &self.metadata) + } + } + + /// Same as `save` but also holds information only relevant for `.new` files. + pub(crate) fn save_new>(&self, path: P) -> Result<(), Box> { + self.save_with_metadata(path, &self.metadata) + } } /// The contents of a Snapshot diff --git a/src/snapshots/insta__test__embedded.snap b/src/snapshots/insta__test__embedded.snap index 3238a349..d0fd9a71 100644 --- a/src/snapshots/insta__test__embedded.snap +++ b/src/snapshots/insta__test__embedded.snap @@ -1,6 +1,5 @@ --- source: src/test.rs -assertion_line: 3 expression: "\"Just a string\"" --- Just a string diff --git a/tests/snapshots/snapshot_no_module_prepending.snap b/tests/snapshots/snapshot_no_module_prepending.snap index 44453de3..da2242ad 100644 --- a/tests/snapshots/snapshot_no_module_prepending.snap +++ b/tests/snapshots/snapshot_no_module_prepending.snap @@ -1,6 +1,5 @@ --- source: tests/test_settings.rs -assertion_line: 74 expression: "vec![1, 2, 3]" --- - 1 diff --git a/tests/snapshots/test_basic__debug_vector.snap b/tests/snapshots/test_basic__debug_vector.snap index 43b2684f..e9f85e09 100644 --- a/tests/snapshots/test_basic__debug_vector.snap +++ b/tests/snapshots/test_basic__debug_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 8 expression: "vec![1, 2, 3]" --- [ diff --git a/tests/snapshots/test_basic__display.snap b/tests/snapshots/test_basic__display.snap index a0b0326f..5e27768b 100644 --- a/tests/snapshots/test_basic__display.snap +++ b/tests/snapshots/test_basic__display.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 69 expression: td --- TestDisplay struct diff --git a/tests/snapshots/test_basic__json_vector.snap b/tests/snapshots/test_basic__json_vector.snap index 51656011..b109d7ff 100644 --- a/tests/snapshots/test_basic__json_vector.snap +++ b/tests/snapshots/test_basic__json_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 41 expression: "vec![1, 2, 3]" --- [ diff --git a/tests/snapshots/test_basic__nested__nested_module.snap b/tests/snapshots/test_basic__nested__nested_module.snap index e7f80832..8bb5a733 100644 --- a/tests/snapshots/test_basic__nested__nested_module.snap +++ b/tests/snapshots/test_basic__nested__nested_module.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 54 expression: "\"aoeu\"" --- aoeu diff --git a/tests/snapshots/test_basic__unnamed_debug_vector-2.snap b/tests/snapshots/test_basic__unnamed_debug_vector-2.snap index 07bdf187..8e84e06f 100644 --- a/tests/snapshots/test_basic__unnamed_debug_vector-2.snap +++ b/tests/snapshots/test_basic__unnamed_debug_vector-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 14 expression: "vec![1, 2, 3, 4]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_debug_vector-3.snap b/tests/snapshots/test_basic__unnamed_debug_vector-3.snap index 6c089862..bff9e210 100644 --- a/tests/snapshots/test_basic__unnamed_debug_vector-3.snap +++ b/tests/snapshots/test_basic__unnamed_debug_vector-3.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 15 expression: "vec![1, 2, 3, 4, 5]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_debug_vector.snap b/tests/snapshots/test_basic__unnamed_debug_vector.snap index d49e12b6..e9f85e09 100644 --- a/tests/snapshots/test_basic__unnamed_debug_vector.snap +++ b/tests/snapshots/test_basic__unnamed_debug_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 13 expression: "vec![1, 2, 3]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_display-2.snap b/tests/snapshots/test_basic__unnamed_display-2.snap index f495ec8e..3e8d2628 100644 --- a/tests/snapshots/test_basic__unnamed_display-2.snap +++ b/tests/snapshots/test_basic__unnamed_display-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 76 expression: "\"whatever\"" --- whatever diff --git a/tests/snapshots/test_basic__unnamed_display.snap b/tests/snapshots/test_basic__unnamed_display.snap index 3dfb4075..5e27768b 100644 --- a/tests/snapshots/test_basic__unnamed_display.snap +++ b/tests/snapshots/test_basic__unnamed_display.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 75 expression: td --- TestDisplay struct diff --git a/tests/snapshots/test_basic__unnamed_json_vector-2.snap b/tests/snapshots/test_basic__unnamed_json_vector-2.snap index 4d1a5895..188511ef 100644 --- a/tests/snapshots/test_basic__unnamed_json_vector-2.snap +++ b/tests/snapshots/test_basic__unnamed_json_vector-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 47 expression: "vec![1, 2, 3, 4]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_json_vector-3.snap b/tests/snapshots/test_basic__unnamed_json_vector-3.snap index 8e8cd45e..81c987d7 100644 --- a/tests/snapshots/test_basic__unnamed_json_vector-3.snap +++ b/tests/snapshots/test_basic__unnamed_json_vector-3.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 48 expression: "vec![1, 2, 3, 4, 5]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_json_vector.snap b/tests/snapshots/test_basic__unnamed_json_vector.snap index 4b71d276..b109d7ff 100644 --- a/tests/snapshots/test_basic__unnamed_json_vector.snap +++ b/tests/snapshots/test_basic__unnamed_json_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 46 expression: "vec![1, 2, 3]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_nested_closure.snap b/tests/snapshots/test_basic__unnamed_nested_closure.snap index 7c3d0d51..e9f85e09 100644 --- a/tests/snapshots/test_basic__unnamed_nested_closure.snap +++ b/tests/snapshots/test_basic__unnamed_nested_closure.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 22 expression: "vec![1, 2, 3]" --- [ diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap b/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap index bad46cd8..ae7ebe8f 100644 --- a/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap +++ b/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 35 expression: "vec![1, 2, 3, 4]" --- - 1 diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap b/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap index e7770044..dfedd920 100644 --- a/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap +++ b/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 36 expression: "vec![1, 2, 3, 4, 5]" --- - 1 diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector.snap b/tests/snapshots/test_basic__unnamed_yaml_vector.snap index 116e3253..bd213c35 100644 --- a/tests/snapshots/test_basic__unnamed_yaml_vector.snap +++ b/tests/snapshots/test_basic__unnamed_yaml_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 34 expression: "vec![1, 2, 3]" --- - 1 diff --git a/tests/snapshots/test_basic__yaml_vector.snap b/tests/snapshots/test_basic__yaml_vector.snap index 2dcbc55e..bd213c35 100644 --- a/tests/snapshots/test_basic__yaml_vector.snap +++ b/tests/snapshots/test_basic__yaml_vector.snap @@ -1,6 +1,5 @@ --- source: tests/test_basic.rs -assertion_line: 29 expression: "vec![1, 2, 3]" --- - 1 diff --git a/tests/snapshots/test_bugs__crlf.snap b/tests/snapshots/test_bugs__crlf.snap index a71fcdf2..e92bbd48 100644 --- a/tests/snapshots/test_bugs__crlf.snap +++ b/tests/snapshots/test_bugs__crlf.snap @@ -1,6 +1,5 @@ --- source: tests/test_bugs.rs -assertion_line: 3 expression: "\"foo\\r\\nbar\\r\\nbaz\"" --- foo diff --git a/tests/snapshots/test_bugs__trailing_crlf.snap b/tests/snapshots/test_bugs__trailing_crlf.snap index 8c1b3ebb..ad8e753e 100644 --- a/tests/snapshots/test_bugs__trailing_crlf.snap +++ b/tests/snapshots/test_bugs__trailing_crlf.snap @@ -1,6 +1,5 @@ --- source: tests/test_bugs.rs -assertion_line: 8 expression: "\"foo\\r\\nbar\\r\\nbaz\\r\\n\"" --- foo diff --git a/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap b/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap index eb3724a8..a16cfe30 100644 --- a/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap +++ b/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap @@ -1,6 +1,5 @@ --- source: tests/test_glob.rs -assertion_line: 7 expression: "&contents" input_file: tests/inputs/goodbye.txt --- diff --git a/tests/snapshots/test_glob__basic_globbing@hello.txt.snap b/tests/snapshots/test_glob__basic_globbing@hello.txt.snap index a5cd720c..6f941346 100644 --- a/tests/snapshots/test_glob__basic_globbing@hello.txt.snap +++ b/tests/snapshots/test_glob__basic_globbing@hello.txt.snap @@ -1,6 +1,5 @@ --- source: tests/test_glob.rs -assertion_line: 7 expression: "&contents" input_file: tests/inputs/hello.txt --- diff --git a/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap b/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap index 8f6d7132..a16cfe30 100644 --- a/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap +++ b/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap @@ -1,6 +1,5 @@ --- source: tests/test_glob.rs -assertion_line: 15 expression: "&contents" input_file: tests/inputs/goodbye.txt --- diff --git a/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap b/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap index 04f6d7b8..6f941346 100644 --- a/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap +++ b/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap @@ -1,6 +1,5 @@ --- source: tests/test_glob.rs -assertion_line: 15 expression: "&contents" input_file: tests/inputs/hello.txt --- diff --git a/tests/snapshots/test_inline__unnamed_single_line-2.snap b/tests/snapshots/test_inline__unnamed_single_line-2.snap index 4dbee20a..01270986 100644 --- a/tests/snapshots/test_inline__unnamed_single_line-2.snap +++ b/tests/snapshots/test_inline__unnamed_single_line-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_inline.rs -assertion_line: 31 expression: "\"Testing-2\"" --- Testing-2 diff --git a/tests/snapshots/test_inline__unnamed_single_line.snap b/tests/snapshots/test_inline__unnamed_single_line.snap index a9c97370..b0b18d17 100644 --- a/tests/snapshots/test_inline__unnamed_single_line.snap +++ b/tests/snapshots/test_inline__unnamed_single_line.snap @@ -1,6 +1,5 @@ --- source: tests/test_inline.rs -assertion_line: 30 expression: "\"Testing\"" --- Testing diff --git a/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap b/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap index aaf13426..506eaaa6 100644 --- a/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap +++ b/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap @@ -1,6 +1,5 @@ --- source: tests/test_inline.rs -assertion_line: 43 expression: "\"Testing-thread-2\"" --- Testing-thread-2 diff --git a/tests/snapshots/test_inline__unnamed_thread_single_line.snap b/tests/snapshots/test_inline__unnamed_thread_single_line.snap index b1e64edd..f0727bc0 100644 --- a/tests/snapshots/test_inline__unnamed_thread_single_line.snap +++ b/tests/snapshots/test_inline__unnamed_thread_single_line.snap @@ -1,6 +1,5 @@ --- source: tests/test_inline.rs -assertion_line: 42 expression: "\"Testing-thread\"" --- Testing-thread diff --git a/tests/snapshots/test_redaction__foo_bar.snap b/tests/snapshots/test_redaction__foo_bar.snap index 6eb168cf..6ff00a89 100644 --- a/tests/snapshots/test_redaction__foo_bar.snap +++ b/tests/snapshots/test_redaction__foo_bar.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 22 expression: "Selector::parse(\".foo.bar\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_alt.snap b/tests/snapshots/test_redaction__foo_bar_alt.snap index 01c7a9f3..e5d3ec16 100644 --- a/tests/snapshots/test_redaction__foo_bar_alt.snap +++ b/tests/snapshots/test_redaction__foo_bar_alt.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 23 expression: "Selector::parse(\".foo[\\\"bar\\\"]\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_deep.snap b/tests/snapshots/test_redaction__foo_bar_deep.snap index d94aedc2..ec936413 100644 --- a/tests/snapshots/test_redaction__foo_bar_deep.snap +++ b/tests/snapshots/test_redaction__foo_bar_deep.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 28 expression: "Selector::parse(\".foo.bar.**\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_full_range.snap b/tests/snapshots/test_redaction__foo_bar_full_range.snap index 5c550962..78432977 100644 --- a/tests/snapshots/test_redaction__foo_bar_full_range.snap +++ b/tests/snapshots/test_redaction__foo_bar_full_range.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 24 expression: "Selector::parse(\".foo.bar[]\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_range.snap b/tests/snapshots/test_redaction__foo_bar_range.snap index 324921c1..6b2d8c37 100644 --- a/tests/snapshots/test_redaction__foo_bar_range.snap +++ b/tests/snapshots/test_redaction__foo_bar_range.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 27 expression: "Selector::parse(\".foo.bar[10:20]\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_range_from.snap b/tests/snapshots/test_redaction__foo_bar_range_from.snap index 364d8a4e..1ec6ad90 100644 --- a/tests/snapshots/test_redaction__foo_bar_range_from.snap +++ b/tests/snapshots/test_redaction__foo_bar_range_from.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 26 expression: "Selector::parse(\".foo.bar[10:]\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__foo_bar_range_to.snap b/tests/snapshots/test_redaction__foo_bar_range_to.snap index 79d0e1d1..45e346dd 100644 --- a/tests/snapshots/test_redaction__foo_bar_range_to.snap +++ b/tests/snapshots/test_redaction__foo_bar_range_to.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 25 expression: "Selector::parse(\".foo.bar[:10]\").unwrap()" --- Selector { diff --git a/tests/snapshots/test_redaction__map_key_redaction.snap b/tests/snapshots/test_redaction__map_key_redaction.snap index ca381f99..1369a45e 100644 --- a/tests/snapshots/test_redaction__map_key_redaction.snap +++ b/tests/snapshots/test_redaction__map_key_redaction.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 340 expression: foo --- hm: diff --git a/tests/snapshots/test_redaction__struct_array_redaction.snap b/tests/snapshots/test_redaction__struct_array_redaction.snap index 03b65e0b..5d64eab9 100644 --- a/tests/snapshots/test_redaction__struct_array_redaction.snap +++ b/tests/snapshots/test_redaction__struct_array_redaction.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 307 expression: "vec![checkout]" --- - _id: "[checkout_id]" diff --git a/tests/snapshots/test_redaction__user.snap b/tests/snapshots/test_redaction__user.snap index f4bead1d..73bdfc2e 100644 --- a/tests/snapshots/test_redaction__user.snap +++ b/tests/snapshots/test_redaction__user.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 56 expression: "&User{id: 23,\n username: \"john_doe\".to_string(),\n email: Email(\"john@example.com\".to_string()),\n extra: \"\".to_string(),}" --- id: "[id]" diff --git a/tests/snapshots/test_redaction__user_csv.snap b/tests/snapshots/test_redaction__user_csv.snap index be0003b9..7df36097 100644 --- a/tests/snapshots/test_redaction__user_csv.snap +++ b/tests/snapshots/test_redaction__user_csv.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 85 expression: "&User{id: 44,\n username: \"julius_csv\".to_string(),\n email: Email(\"julius@example.com\".to_string()),\n extra: \"\".to_string(),}" --- id,username,email,extra diff --git a/tests/snapshots/test_redaction__user_json.snap b/tests/snapshots/test_redaction__user_json.snap index bd9dc4ab..c8ed9d88 100644 --- a/tests/snapshots/test_redaction__user_json.snap +++ b/tests/snapshots/test_redaction__user_json.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 123 expression: "&User{id: 9999,\n username: \"jason_doe\".to_string(),\n email: Email(\"jason@example.com\".to_string()),\n extra: \"ssn goes here\".to_string(),}" --- { diff --git a/tests/snapshots/test_redaction__user_json_flags.snap b/tests/snapshots/test_redaction__user_json_flags.snap index 6a6718a9..bff83c81 100644 --- a/tests/snapshots/test_redaction__user_json_flags.snap +++ b/tests/snapshots/test_redaction__user_json_flags.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 359 expression: "&User{id: 122,\n username: \"jason_doe\".to_string(),\n flags:\n vec![\"zzz\".into(), \"foo\".into(), \"aha\".into(),\n \"is_admin\".into()].into_iter().collect(),}" --- { diff --git a/tests/snapshots/test_redaction__user_json_flags_alt.snap b/tests/snapshots/test_redaction__user_json_flags_alt.snap index bc80e6b0..31ef997d 100644 --- a/tests/snapshots/test_redaction__user_json_flags_alt.snap +++ b/tests/snapshots/test_redaction__user_json_flags_alt.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 384 expression: "&User{id: 122,\n username: \"jason_doe\".to_string(),\n flags:\n MySet(vec![\"zzz\".into(), \"foo\".into(), \"aha\".into(),\n \"is_admin\".into()].into_iter().collect()),}" --- { diff --git a/tests/snapshots/test_redaction__user_json_settings.snap b/tests/snapshots/test_redaction__user_json_settings.snap index 2c6748cd..c7429973 100644 --- a/tests/snapshots/test_redaction__user_json_settings.snap +++ b/tests/snapshots/test_redaction__user_json_settings.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 140 expression: "&User{id: 122,\n username: \"jason_doe\".to_string(),\n email: Email(\"jason@example.com\".to_string()),\n extra: \"ssn goes here\".to_string(),}" --- { diff --git a/tests/snapshots/test_redaction__user_json_settings_callback.snap b/tests/snapshots/test_redaction__user_json_settings_callback.snap index eaf795d1..e80e7e81 100644 --- a/tests/snapshots/test_redaction__user_json_settings_callback.snap +++ b/tests/snapshots/test_redaction__user_json_settings_callback.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 161 expression: "&User{id: 1234,\n username: \"jason_doe\".to_string(),\n email: Email(\"jason@example.com\".to_string()),\n extra: \"extra here\".to_string(),}" --- { diff --git a/tests/snapshots/test_redaction__user_ron.snap b/tests/snapshots/test_redaction__user_ron.snap index 52140ab0..da83abb3 100644 --- a/tests/snapshots/test_redaction__user_ron.snap +++ b/tests/snapshots/test_redaction__user_ron.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 98 expression: "&User{id: 53,\n username: \"john_ron\".to_string(),\n email: Email(\"john@example.com\".to_string()),\n extra: \"\".to_string(),}" --- User( diff --git a/tests/snapshots/test_redaction__user_toml.snap b/tests/snapshots/test_redaction__user_toml.snap index fee11756..4485e44a 100644 --- a/tests/snapshots/test_redaction__user_toml.snap +++ b/tests/snapshots/test_redaction__user_toml.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 111 expression: "&User{id: 53,\n username: \"john_ron\".to_string(),\n email: Email(\"john@example.com\".to_string()),\n extra: \"\".to_string(),}" --- id = '[id]' diff --git a/tests/snapshots/test_redaction__with_random_value_json_settings2.snap b/tests/snapshots/test_redaction__with_random_value_json_settings2.snap index ca8b77e8..72e4e062 100644 --- a/tests/snapshots/test_redaction__with_random_value_json_settings2.snap +++ b/tests/snapshots/test_redaction__with_random_value_json_settings2.snap @@ -1,6 +1,5 @@ --- source: tests/test_redaction.rs -assertion_line: 179 expression: "&User{id: 975,\n username: \"jason_doe\".to_string(),\n email: Email(\"jason@example.com\".to_string()),\n extra: \"ssn goes here\".to_string(),}" --- { diff --git a/tests/snapshots/test_suffixes__basic_suffixes@1.snap b/tests/snapshots/test_suffixes__basic_suffixes@1.snap index 7b8be57c..ae952e96 100644 --- a/tests/snapshots/test_suffixes__basic_suffixes@1.snap +++ b/tests/snapshots/test_suffixes__basic_suffixes@1.snap @@ -1,6 +1,5 @@ --- source: tests/test_suffixes.rs -assertion_line: 5 expression: "&value" --- 1 diff --git a/tests/snapshots/test_suffixes__basic_suffixes@2.snap b/tests/snapshots/test_suffixes__basic_suffixes@2.snap index 67944f77..43655f25 100644 --- a/tests/snapshots/test_suffixes__basic_suffixes@2.snap +++ b/tests/snapshots/test_suffixes__basic_suffixes@2.snap @@ -1,6 +1,5 @@ --- source: tests/test_suffixes.rs -assertion_line: 5 expression: "&value" --- 2 diff --git a/tests/snapshots/test_suffixes__basic_suffixes@3.snap b/tests/snapshots/test_suffixes__basic_suffixes@3.snap index 140b8f53..a8fd7b3e 100644 --- a/tests/snapshots/test_suffixes__basic_suffixes@3.snap +++ b/tests/snapshots/test_suffixes__basic_suffixes@3.snap @@ -1,6 +1,5 @@ --- source: tests/test_suffixes.rs -assertion_line: 5 expression: "&value" --- 3 diff --git a/tests/snapshots2/test_settings__snapshot_path.snap b/tests/snapshots2/test_settings__snapshot_path.snap index e2019ddf..da2242ad 100644 --- a/tests/snapshots2/test_settings__snapshot_path.snap +++ b/tests/snapshots2/test_settings__snapshot_path.snap @@ -1,6 +1,5 @@ --- source: tests/test_settings.rs -assertion_line: 67 expression: "vec![1, 2, 3]" --- - 1