From 4dcccca2c7e25d205351f7215a9a9f9e7a79e98d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 28 Mar 2024 11:21:21 +0100 Subject: [PATCH] Move insta to folder (#470) --- .github/workflows/tests.yml | 7 +- Cargo.lock.msrv | 151 +----------------- Cargo.toml | 69 -------- Makefile | 16 +- cargo-insta/Cargo.toml | 2 +- cargo-insta/tests/main.rs | 3 - insta/Cargo.toml | 68 ++++++++ insta/LICENSE | 1 + insta/README.md | 1 + {src => insta/src}/content/json.rs | 0 {src => insta/src}/content/mod.rs | 0 {src => insta/src}/content/serialization.rs | 0 {src => insta/src}/content/yaml/mod.rs | 0 .../src}/content/yaml/vendored/emitter.rs | 0 .../src}/content/yaml/vendored/mod.rs | 0 .../src}/content/yaml/vendored/parser.rs | 0 .../src}/content/yaml/vendored/scanner.rs | 0 .../src}/content/yaml/vendored/yaml.rs | 0 {src => insta/src}/env.rs | 0 {src => insta/src}/filters.rs | 0 {src => insta/src}/glob.rs | 0 {src => insta/src}/lib.rs | 0 {src => insta/src}/macros.rs | 0 {src => insta/src}/output.rs | 0 {src => insta/src}/redaction.rs | 0 {src => insta/src}/runtime.rs | 7 +- {src => insta/src}/select_grammar.pest | 0 {src => insta/src}/serialization.rs | 0 {src => insta/src}/settings.rs | 0 {src => insta/src}/snapshot.rs | 0 .../snapshots/doctest_runtime_rs__named.snap | 0 .../src}/snapshots/insta__test__embedded.snap | 0 {src => insta/src}/test.rs | 0 {src => insta/src}/utils.rs | 0 {tests => insta/tests}/glob_submodule/mod.rs | 0 ...sic_globbing_absolute_dir@goodbye.txt.snap | 0 ...basic_globbing_absolute_dir@hello.txt.snap | 0 ...sted_parent_dir_base_path@a__file.txt.snap | 0 ...sted_parent_dir_base_path@b__file.txt.snap | 0 ...obbing_nested_parent_glob@a__file.txt.snap | 0 ...obbing_nested_parent_glob@b__file.txt.snap | 0 ...basic_globbing_parent_dir@goodbye.txt.snap | 0 ...__basic_globbing_parent_dir@hello.txt.snap | 0 ...inks_parent_dir_base_path@goodbye.txt.snap | 0 ..._links_parent_dir_base_path@hello.txt.snap | 0 ...low_links_parent_dir_glob@goodbye.txt.snap | 0 ...ollow_links_parent_dir_glob@hello.txt.snap | 0 .../tests}/inputs-nested/a/file.txt | 0 .../tests}/inputs-nested/b/file.txt | 0 {tests => insta/tests}/inputs/goodbye.txt | 0 {tests => insta/tests}/inputs/hello.txt | 0 {tests => insta/tests}/link-to-inputs | 0 .../snapshot_no_module_prepending.snap | 0 .../tests}/snapshots/test_basic__Testing.snap | 0 .../snapshots/test_basic__debug_vector.snap | 0 .../tests}/snapshots/test_basic__display.snap | 0 .../test_basic__insta_sort_order.snap | 0 .../snapshots/test_basic__json_vector.snap | 0 .../test_basic__nested__nested_module.snap | 0 .../test_basic__trailing_commas-2.snap | 0 .../test_basic__trailing_commas.snap | 0 .../test_basic__unnamed_debug_vector-2.snap | 0 .../test_basic__unnamed_debug_vector-3.snap | 0 .../test_basic__unnamed_debug_vector.snap | 0 .../test_basic__unnamed_display-2.snap | 0 .../test_basic__unnamed_display.snap | 0 .../test_basic__unnamed_json_vector-2.snap | 0 .../test_basic__unnamed_json_vector-3.snap | 0 .../test_basic__unnamed_json_vector.snap | 0 .../test_basic__unnamed_nested_closure.snap | 0 .../test_basic__unnamed_yaml_vector-2.snap | 0 .../test_basic__unnamed_yaml_vector-3.snap | 0 .../test_basic__unnamed_yaml_vector.snap | 0 .../snapshots/test_basic__yaml_vector.snap | 0 .../tests}/snapshots/test_bugs__crlf.snap | 0 .../snapshots/test_bugs__trailing_crlf.snap | 0 ...test_glob__basic_globbing@goodbye.txt.snap | 0 .../test_glob__basic_globbing@hello.txt.snap | 0 ...ob__basic_globbing_nested@a__file.txt.snap | 0 ...ob__basic_globbing_nested@b__file.txt.snap | 0 ..._glob__globs_follow_links@goodbye.txt.snap | 0 ...st_glob__globs_follow_links@hello.txt.snap | 0 ..._inline__unnamed_thread_single_line-2.snap | 0 ...st_inline__unnamed_thread_single_line.snap | 0 .../snapshots/test_redaction__foo_bar.snap | 0 .../test_redaction__foo_bar_alt.snap | 0 .../test_redaction__foo_bar_deep.snap | 0 .../test_redaction__foo_bar_full_range.snap | 0 .../test_redaction__foo_bar_range.snap | 0 .../test_redaction__foo_bar_range_from.snap | 0 .../test_redaction__foo_bar_range_to.snap | 0 .../test_redaction__map_key_redaction.snap | 0 .../test_redaction__rounded_redaction.snap | 0 ...est_redaction__struct_array_redaction.snap | 0 .../snapshots/test_redaction__user.snap | 0 .../snapshots/test_redaction__user_csv.snap | 0 .../snapshots/test_redaction__user_json.snap | 0 .../test_redaction__user_json_flags.snap | 0 .../test_redaction__user_json_flags_alt.snap | 0 .../test_redaction__user_json_settings.snap | 0 ...edaction__user_json_settings_callback.snap | 0 .../snapshots/test_redaction__user_ron.snap | 0 .../snapshots/test_redaction__user_toml.snap | 0 ...__with_random_value_and_match_comma-2.snap | 0 ...on__with_random_value_and_match_comma.snap | 0 ...random_value_and_trailing_comma_match.snap | 0 ...edaction__with_random_value_csv_match.snap | 0 ...daction__with_random_value_json_match.snap | 0 ...ion__with_random_value_json_settings2.snap | 0 ...edaction__with_random_value_ron_match.snap | 0 ...daction__with_random_value_toml_match.snap | 0 ...t_settings__snapshot_with_description.snap | 0 ...s__snapshot_with_description_and_info.snap | 0 ...napshot_with_description_and_raw_info.snap | 0 .../test_suffixes__basic_suffixes@1.snap | 0 .../test_suffixes__basic_suffixes@2.snap | 0 .../test_suffixes__basic_suffixes@3.snap | 0 .../test_settings__snapshot_path.snap | 0 .../tests}/test_allow_duplicates.rs | 0 {tests => insta/tests}/test_basic.rs | 0 {tests => insta/tests}/test_bugs.rs | 0 .../tests}/test_clash_detection.rs | 0 {tests => insta/tests}/test_filters.rs | 0 {tests => insta/tests}/test_glob.rs | 0 {tests => insta/tests}/test_inline.rs | 0 {tests => insta/tests}/test_redaction.rs | 0 {tests => insta/tests}/test_settings.rs | 0 {tests => insta/tests}/test_suffixes.rs | 0 scripts/bump-version.sh | 3 +- 129 files changed, 96 insertions(+), 232 deletions(-) create mode 100644 insta/Cargo.toml create mode 120000 insta/LICENSE create mode 120000 insta/README.md rename {src => insta/src}/content/json.rs (100%) rename {src => insta/src}/content/mod.rs (100%) rename {src => insta/src}/content/serialization.rs (100%) rename {src => insta/src}/content/yaml/mod.rs (100%) rename {src => insta/src}/content/yaml/vendored/emitter.rs (100%) rename {src => insta/src}/content/yaml/vendored/mod.rs (100%) rename {src => insta/src}/content/yaml/vendored/parser.rs (100%) rename {src => insta/src}/content/yaml/vendored/scanner.rs (100%) rename {src => insta/src}/content/yaml/vendored/yaml.rs (100%) rename {src => insta/src}/env.rs (100%) rename {src => insta/src}/filters.rs (100%) rename {src => insta/src}/glob.rs (100%) rename {src => insta/src}/lib.rs (100%) rename {src => insta/src}/macros.rs (100%) rename {src => insta/src}/output.rs (100%) rename {src => insta/src}/redaction.rs (100%) rename {src => insta/src}/runtime.rs (98%) rename {src => insta/src}/select_grammar.pest (100%) rename {src => insta/src}/serialization.rs (100%) rename {src => insta/src}/settings.rs (100%) rename {src => insta/src}/snapshot.rs (100%) rename {src => insta/src}/snapshots/doctest_runtime_rs__named.snap (100%) rename {src => insta/src}/snapshots/insta__test__embedded.snap (100%) rename {src => insta/src}/test.rs (100%) rename {src => insta/src}/utils.rs (100%) rename {tests => insta/tests}/glob_submodule/mod.rs (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@goodbye.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@hello.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@a__file.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@b__file.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@a__file.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@b__file.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@goodbye.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@hello.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@goodbye.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@hello.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@goodbye.txt.snap (100%) rename {tests => insta/tests}/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@hello.txt.snap (100%) rename {tests => insta/tests}/inputs-nested/a/file.txt (100%) rename {tests => insta/tests}/inputs-nested/b/file.txt (100%) rename {tests => insta/tests}/inputs/goodbye.txt (100%) rename {tests => insta/tests}/inputs/hello.txt (100%) rename {tests => insta/tests}/link-to-inputs (100%) rename {tests => insta/tests}/snapshots/snapshot_no_module_prepending.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__Testing.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__debug_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__display.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__insta_sort_order.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__json_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__nested__nested_module.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__trailing_commas-2.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__trailing_commas.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_debug_vector-2.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_debug_vector-3.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_debug_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_display-2.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_display.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_json_vector-2.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_json_vector-3.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_json_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_nested_closure.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_yaml_vector-2.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_yaml_vector-3.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__unnamed_yaml_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_basic__yaml_vector.snap (100%) rename {tests => insta/tests}/snapshots/test_bugs__crlf.snap (100%) rename {tests => insta/tests}/snapshots/test_bugs__trailing_crlf.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__basic_globbing@goodbye.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__basic_globbing@hello.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__basic_globbing_nested@a__file.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__basic_globbing_nested@b__file.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__globs_follow_links@goodbye.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_glob__globs_follow_links@hello.txt.snap (100%) rename {tests => insta/tests}/snapshots/test_inline__unnamed_thread_single_line-2.snap (100%) rename {tests => insta/tests}/snapshots/test_inline__unnamed_thread_single_line.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_alt.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_deep.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_full_range.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_range.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_range_from.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__foo_bar_range_to.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__map_key_redaction.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__rounded_redaction.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__struct_array_redaction.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_csv.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_json.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_json_flags.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_json_flags_alt.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_json_settings.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_json_settings_callback.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_ron.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__user_toml.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_and_match_comma-2.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_and_match_comma.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_and_trailing_comma_match.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_csv_match.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_json_match.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_json_settings2.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_ron_match.snap (100%) rename {tests => insta/tests}/snapshots/test_redaction__with_random_value_toml_match.snap (100%) rename {tests => insta/tests}/snapshots/test_settings__snapshot_with_description.snap (100%) rename {tests => insta/tests}/snapshots/test_settings__snapshot_with_description_and_info.snap (100%) rename {tests => insta/tests}/snapshots/test_settings__snapshot_with_description_and_raw_info.snap (100%) rename {tests => insta/tests}/snapshots/test_suffixes__basic_suffixes@1.snap (100%) rename {tests => insta/tests}/snapshots/test_suffixes__basic_suffixes@2.snap (100%) rename {tests => insta/tests}/snapshots/test_suffixes__basic_suffixes@3.snap (100%) rename {tests => insta/tests}/snapshots2/test_settings__snapshot_path.snap (100%) rename {tests => insta/tests}/test_allow_duplicates.rs (100%) rename {tests => insta/tests}/test_basic.rs (100%) rename {tests => insta/tests}/test_bugs.rs (100%) rename {tests => insta/tests}/test_clash_detection.rs (100%) rename {tests => insta/tests}/test_filters.rs (100%) rename {tests => insta/tests}/test_glob.rs (100%) rename {tests => insta/tests}/test_inline.rs (100%) rename {tests => insta/tests}/test_redaction.rs (100%) rename {tests => insta/tests}/test_settings.rs (100%) rename {tests => insta/tests}/test_suffixes.rs (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d79cfd2d..a38cf72d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,5 +40,10 @@ jobs: with: toolchain: 1.51.0 - uses: Swatinem/rust-cache@v2 + - name: Use Cargo.lock.msrv + run: cp Cargo.lock.msrv Cargo.lock + - name: Remove named profile + run: | + perl -ni -e 'print unless /\[profile\.dist\]/ .. eof' Cargo.toml - name: Check - run: cargo check --no-default-features + run: cargo check -p insta --no-default-features diff --git a/Cargo.lock.msrv b/Cargo.lock.msrv index 7774c40c..3528d98a 100644 --- a/Cargo.lock.msrv +++ b/Cargo.lock.msrv @@ -11,12 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - [[package]] name = "base64" version = "0.13.1" @@ -61,7 +55,7 @@ dependencies = [ [[package]] name = "cargo-insta" -version = "1.33.0" +version = "1.37.0" dependencies = [ "cargo_metadata", "console", @@ -74,6 +68,7 @@ dependencies = [ "syn", "tempfile", "uuid", + "walkdir", ] [[package]] @@ -144,64 +139,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" -dependencies = [ - "cfg-if", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.11" @@ -254,23 +191,6 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "dircpy" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8466f8d28ca6da4c9dfbbef6ad4bff6f2fdd5e412d821025b0d3f0a9d74a8c1e" -dependencies = [ - "jwalk", - "log", - "walkdir", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -382,7 +302,7 @@ dependencies = [ [[package]] name = "insta" -version = "1.33.0" +version = "1.37.0" dependencies = [ "console", "csv", @@ -398,7 +318,6 @@ dependencies = [ "similar-asserts", "toml", "walkdir", - "yaml-rust", ] [[package]] @@ -410,16 +329,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "integration-tests" -version = "0.1.0" -dependencies = [ - "dircpy", - "insta", - "serde", - "walkdir", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -443,16 +352,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" -[[package]] -name = "jwalk" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" -dependencies = [ - "crossbeam", - "rayon", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -492,15 +391,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.14.0" @@ -593,26 +483,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -685,12 +555,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "semver" version = "1.0.19" @@ -1096,12 +960,3 @@ name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] diff --git a/Cargo.toml b/Cargo.toml index 40723767..3ddeb14d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,3 @@ -[package] -name = "insta" -version = "1.37.0" -license = "Apache-2.0" -authors = ["Armin Ronacher "] -description = "A snapshot testing library for Rust" -edition = "2018" -rust-version = "1.51.0" -homepage = "https://insta.rs/" -repository = "https://github.com/mitsuhiko/insta" -keywords = ["snapshot", "testing", "jest", "approval"] -categories = ["development-tools::testing"] -readme = "README.md" -exclude = [ - "assets/*" -] - -[package.metadata.docs.rs] -all-features = true -rustdoc-args = ["--cfg", "docsrs"] - [workspace] members = ["cargo-insta"] @@ -31,54 +10,6 @@ pr-run-mode = "plan" install-updater = false precise-builds = true -[features] -default = ["colors"] - -# when the redactions feature is enabled values can be redacted in serialized -# snapshots. -redactions = ["pest", "pest_derive", "serde"] - -# Enables support for running filters on snapshot -filters = ["regex"] - -# Glob support -glob = ["walkdir", "globset"] - -# Color support -colors = ["console"] - -# Serialization formats -# TODO: This could be cleaner by using "dep:csv" without renaming the dep, but -# this technique allows for a lower MSRV -csv = ["dep_csv", "serde"] -json = ["serde"] -ron = ["dep_ron", "serde"] -toml = ["dep_toml", "serde"] -yaml = ["serde"] - -# internal feature exclusive to cargo-insta -_cargo_insta_internal = [] - -[dependencies] -dep_csv = { package = "csv", version = "=1.1.6", optional = true } -console = { version = "0.15.4", optional = true, default-features = false } -pest = { version = "2.1.3", optional = true } -pest_derive = { version = "2.1.0", optional = true } -dep_ron = { package = "ron", version = "0.7.1", optional = true } -dep_toml = { package = "toml", version = "0.5.7", optional = true } -globset = { version = "0.4.6", optional = true } -walkdir = { version = "2.3.1", optional = true } -similar = { version = "2.1.0", features = ["inline"] } -regex = { version = "1.6.0", default-features = false, optional = true, features = ["std", "unicode"] } -serde = { version = "1.0.117", optional = true } -linked-hash-map = "0.5.6" -lazy_static = "1.4.0" - -[dev-dependencies] -serde = { version = "1.0.117", features = ["derive"] } -similar-asserts = "1.4.2" - -# The profile that 'cargo dist' will build with [profile.dist] inherits = "release" lto = "thin" diff --git a/Makefile b/Makefile index 1df76946..f1bc71a4 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,10 @@ test: cargotest cargotest: @echo "CARGO TESTS" @rustup component add rustfmt 2> /dev/null - @cargo test - @cargo test --all-features - @cargo test --no-default-features - @cargo test --features redactions -- --test-threads 1 + @cargo test -p insta + @cargo test -p insta --all-features + @cargo test -p insta --no-default-features + @cargo test -p insta --features redactions -- --test-threads 1 @echo "CARGO-INSTA TESTS" # Turn off CI flag so that cargo insta test behaves as we expect # under normal operation @@ -22,10 +22,10 @@ cargotest: check-minver: @echo "MINVER CHECK" - @cargo minimal-versions check - @cargo minimal-versions check --all-features - @cargo minimal-versions check --no-default-features - @cargo minimal-versions check --features redactions + @cargo minimal-versions check -p insta + @cargo minimal-versions check -p insta --all-features + @cargo minimal-versions check -p insta --no-default-features + @cargo minimal-versions check -p insta --features redactions format: @rustup component add rustfmt 2> /dev/null diff --git a/cargo-insta/Cargo.toml b/cargo-insta/Cargo.toml index ad7b92d2..e565875a 100644 --- a/cargo-insta/Cargo.toml +++ b/cargo-insta/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" readme = "README.md" [dependencies] -insta = { version = "=1.37.0", path = "..", features = ["json", "yaml", "redactions", "_cargo_insta_internal"] } +insta = { version = "=1.37.0", path = "../insta", features = ["json", "yaml", "redactions", "_cargo_insta_internal"] } cargo_metadata = { version = "0.18.0", default-features = false } console = "0.15.4" structopt = { version = "0.3.26", default-features = false } diff --git a/cargo-insta/tests/main.rs b/cargo-insta/tests/main.rs index 017aa11e..8ba8a1fa 100644 --- a/cargo-insta/tests/main.rs +++ b/cargo-insta/tests/main.rs @@ -68,11 +68,8 @@ fn main() { std::io::stderr().write_all(&stderr).unwrap(); assert!(status.success()); let stdout = std::str::from_utf8(stdout.as_slice()).unwrap(); - let stderr = std::str::from_utf8(stderr.as_slice()).unwrap(); assert!(stdout.contains("insta review finished")); assert!(stdout.contains("accepted")); - assert!(stderr.contains("Compiling")); - assert!(stderr.contains("cargo-insta")); // use insta itself to assert snapshots for entry in WalkDir::new(SRC) { diff --git a/insta/Cargo.toml b/insta/Cargo.toml new file mode 100644 index 00000000..042e5762 --- /dev/null +++ b/insta/Cargo.toml @@ -0,0 +1,68 @@ +[package] +name = "insta" +version = "1.37.0" +license = "Apache-2.0" +authors = ["Armin Ronacher "] +description = "A snapshot testing library for Rust" +edition = "2018" +rust-version = "1.51.0" +homepage = "https://insta.rs/" +repository = "https://github.com/mitsuhiko/insta" +keywords = ["snapshot", "testing", "jest", "approval"] +categories = ["development-tools::testing"] +readme = "README.md" +exclude = [ + "assets/*" +] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[features] +default = ["colors"] + +# when the redactions feature is enabled values can be redacted in serialized +# snapshots. +redactions = ["pest", "pest_derive", "serde"] + +# Enables support for running filters on snapshot +filters = ["regex"] + +# Glob support +glob = ["walkdir", "globset"] + +# Color support +colors = ["console"] + +# Serialization formats +# TODO: This could be cleaner by using "dep:csv" without renaming the dep, but +# this technique allows for a lower MSRV +csv = ["dep_csv", "serde"] +json = ["serde"] +ron = ["dep_ron", "serde"] +toml = ["dep_toml", "serde"] +yaml = ["serde"] + +# internal feature exclusive to cargo-insta +_cargo_insta_internal = [] + +[dependencies] +dep_csv = { package = "csv", version = "=1.1.6", optional = true } +console = { version = "0.15.4", optional = true, default-features = false } +pest = { version = "2.1.3", optional = true } +pest_derive = { version = "2.1.0", optional = true } +dep_ron = { package = "ron", version = "0.7.1", optional = true } +dep_toml = { package = "toml", version = "0.5.7", optional = true } +globset = { version = "0.4.6", optional = true } +walkdir = { version = "2.3.1", optional = true } +similar = { version = "2.1.0", features = ["inline"] } +regex = { version = "1.6.0", default-features = false, optional = true, features = ["std", "unicode"] } +serde = { version = "1.0.117", optional = true } +linked-hash-map = "0.5.6" +lazy_static = "1.4.0" + +[dev-dependencies] +rustc_version = "0.4.0" +serde = { version = "1.0.117", features = ["derive"] } +similar-asserts = "1.4.2" diff --git a/insta/LICENSE b/insta/LICENSE new file mode 120000 index 00000000..ea5b6064 --- /dev/null +++ b/insta/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/insta/README.md b/insta/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/insta/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/src/content/json.rs b/insta/src/content/json.rs similarity index 100% rename from src/content/json.rs rename to insta/src/content/json.rs diff --git a/src/content/mod.rs b/insta/src/content/mod.rs similarity index 100% rename from src/content/mod.rs rename to insta/src/content/mod.rs diff --git a/src/content/serialization.rs b/insta/src/content/serialization.rs similarity index 100% rename from src/content/serialization.rs rename to insta/src/content/serialization.rs diff --git a/src/content/yaml/mod.rs b/insta/src/content/yaml/mod.rs similarity index 100% rename from src/content/yaml/mod.rs rename to insta/src/content/yaml/mod.rs diff --git a/src/content/yaml/vendored/emitter.rs b/insta/src/content/yaml/vendored/emitter.rs similarity index 100% rename from src/content/yaml/vendored/emitter.rs rename to insta/src/content/yaml/vendored/emitter.rs diff --git a/src/content/yaml/vendored/mod.rs b/insta/src/content/yaml/vendored/mod.rs similarity index 100% rename from src/content/yaml/vendored/mod.rs rename to insta/src/content/yaml/vendored/mod.rs diff --git a/src/content/yaml/vendored/parser.rs b/insta/src/content/yaml/vendored/parser.rs similarity index 100% rename from src/content/yaml/vendored/parser.rs rename to insta/src/content/yaml/vendored/parser.rs diff --git a/src/content/yaml/vendored/scanner.rs b/insta/src/content/yaml/vendored/scanner.rs similarity index 100% rename from src/content/yaml/vendored/scanner.rs rename to insta/src/content/yaml/vendored/scanner.rs diff --git a/src/content/yaml/vendored/yaml.rs b/insta/src/content/yaml/vendored/yaml.rs similarity index 100% rename from src/content/yaml/vendored/yaml.rs rename to insta/src/content/yaml/vendored/yaml.rs diff --git a/src/env.rs b/insta/src/env.rs similarity index 100% rename from src/env.rs rename to insta/src/env.rs diff --git a/src/filters.rs b/insta/src/filters.rs similarity index 100% rename from src/filters.rs rename to insta/src/filters.rs diff --git a/src/glob.rs b/insta/src/glob.rs similarity index 100% rename from src/glob.rs rename to insta/src/glob.rs diff --git a/src/lib.rs b/insta/src/lib.rs similarity index 100% rename from src/lib.rs rename to insta/src/lib.rs diff --git a/src/macros.rs b/insta/src/macros.rs similarity index 100% rename from src/macros.rs rename to insta/src/macros.rs diff --git a/src/output.rs b/insta/src/output.rs similarity index 100% rename from src/output.rs rename to insta/src/output.rs diff --git a/src/redaction.rs b/insta/src/redaction.rs similarity index 100% rename from src/redaction.rs rename to insta/src/redaction.rs diff --git a/src/runtime.rs b/insta/src/runtime.rs similarity index 98% rename from src/runtime.rs rename to insta/src/runtime.rs index d61c25a0..36342377 100644 --- a/src/runtime.rs +++ b/insta/src/runtime.rs @@ -697,7 +697,12 @@ pub fn assert_snapshot( /// Test snapshots in doctests. /// /// ``` -/// insta::assert_debug_snapshot!("named", vec![1, 2, 3, 4, 5]); +/// // this is only working on newer rust versions +/// extern crate rustc_version; +/// use rustc_version::{Version, version}; +/// if version().unwrap() > Version::parse("1.72.0").unwrap() { +/// insta::assert_debug_snapshot!("named", vec![1, 2, 3, 4, 5]); +/// } /// ``` /// /// ```should_panic diff --git a/src/select_grammar.pest b/insta/src/select_grammar.pest similarity index 100% rename from src/select_grammar.pest rename to insta/src/select_grammar.pest diff --git a/src/serialization.rs b/insta/src/serialization.rs similarity index 100% rename from src/serialization.rs rename to insta/src/serialization.rs diff --git a/src/settings.rs b/insta/src/settings.rs similarity index 100% rename from src/settings.rs rename to insta/src/settings.rs diff --git a/src/snapshot.rs b/insta/src/snapshot.rs similarity index 100% rename from src/snapshot.rs rename to insta/src/snapshot.rs diff --git a/src/snapshots/doctest_runtime_rs__named.snap b/insta/src/snapshots/doctest_runtime_rs__named.snap similarity index 100% rename from src/snapshots/doctest_runtime_rs__named.snap rename to insta/src/snapshots/doctest_runtime_rs__named.snap diff --git a/src/snapshots/insta__test__embedded.snap b/insta/src/snapshots/insta__test__embedded.snap similarity index 100% rename from src/snapshots/insta__test__embedded.snap rename to insta/src/snapshots/insta__test__embedded.snap diff --git a/src/test.rs b/insta/src/test.rs similarity index 100% rename from src/test.rs rename to insta/src/test.rs diff --git a/src/utils.rs b/insta/src/utils.rs similarity index 100% rename from src/utils.rs rename to insta/src/utils.rs diff --git a/tests/glob_submodule/mod.rs b/insta/tests/glob_submodule/mod.rs similarity index 100% rename from tests/glob_submodule/mod.rs rename to insta/tests/glob_submodule/mod.rs diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@goodbye.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@goodbye.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@goodbye.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@goodbye.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@hello.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@hello.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@hello.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_absolute_dir@hello.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@a__file.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@a__file.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@a__file.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@a__file.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@b__file.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@b__file.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@b__file.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_dir_base_path@b__file.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@a__file.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@a__file.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@a__file.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@a__file.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@b__file.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@b__file.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@b__file.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_nested_parent_glob@b__file.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@goodbye.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@goodbye.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@goodbye.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@goodbye.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@hello.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@hello.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@hello.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__basic_globbing_parent_dir@hello.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@goodbye.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@goodbye.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@goodbye.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@goodbye.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@hello.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@hello.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@hello.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_base_path@hello.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@goodbye.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@goodbye.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@goodbye.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@goodbye.txt.snap diff --git a/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@hello.txt.snap b/insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@hello.txt.snap similarity index 100% rename from tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@hello.txt.snap rename to insta/tests/glob_submodule/snapshots/test_glob__glob_submodule__globs_follow_links_parent_dir_glob@hello.txt.snap diff --git a/tests/inputs-nested/a/file.txt b/insta/tests/inputs-nested/a/file.txt similarity index 100% rename from tests/inputs-nested/a/file.txt rename to insta/tests/inputs-nested/a/file.txt diff --git a/tests/inputs-nested/b/file.txt b/insta/tests/inputs-nested/b/file.txt similarity index 100% rename from tests/inputs-nested/b/file.txt rename to insta/tests/inputs-nested/b/file.txt diff --git a/tests/inputs/goodbye.txt b/insta/tests/inputs/goodbye.txt similarity index 100% rename from tests/inputs/goodbye.txt rename to insta/tests/inputs/goodbye.txt diff --git a/tests/inputs/hello.txt b/insta/tests/inputs/hello.txt similarity index 100% rename from tests/inputs/hello.txt rename to insta/tests/inputs/hello.txt diff --git a/tests/link-to-inputs b/insta/tests/link-to-inputs similarity index 100% rename from tests/link-to-inputs rename to insta/tests/link-to-inputs diff --git a/tests/snapshots/snapshot_no_module_prepending.snap b/insta/tests/snapshots/snapshot_no_module_prepending.snap similarity index 100% rename from tests/snapshots/snapshot_no_module_prepending.snap rename to insta/tests/snapshots/snapshot_no_module_prepending.snap diff --git a/tests/snapshots/test_basic__Testing.snap b/insta/tests/snapshots/test_basic__Testing.snap similarity index 100% rename from tests/snapshots/test_basic__Testing.snap rename to insta/tests/snapshots/test_basic__Testing.snap diff --git a/tests/snapshots/test_basic__debug_vector.snap b/insta/tests/snapshots/test_basic__debug_vector.snap similarity index 100% rename from tests/snapshots/test_basic__debug_vector.snap rename to insta/tests/snapshots/test_basic__debug_vector.snap diff --git a/tests/snapshots/test_basic__display.snap b/insta/tests/snapshots/test_basic__display.snap similarity index 100% rename from tests/snapshots/test_basic__display.snap rename to insta/tests/snapshots/test_basic__display.snap diff --git a/tests/snapshots/test_basic__insta_sort_order.snap b/insta/tests/snapshots/test_basic__insta_sort_order.snap similarity index 100% rename from tests/snapshots/test_basic__insta_sort_order.snap rename to insta/tests/snapshots/test_basic__insta_sort_order.snap diff --git a/tests/snapshots/test_basic__json_vector.snap b/insta/tests/snapshots/test_basic__json_vector.snap similarity index 100% rename from tests/snapshots/test_basic__json_vector.snap rename to insta/tests/snapshots/test_basic__json_vector.snap diff --git a/tests/snapshots/test_basic__nested__nested_module.snap b/insta/tests/snapshots/test_basic__nested__nested_module.snap similarity index 100% rename from tests/snapshots/test_basic__nested__nested_module.snap rename to insta/tests/snapshots/test_basic__nested__nested_module.snap diff --git a/tests/snapshots/test_basic__trailing_commas-2.snap b/insta/tests/snapshots/test_basic__trailing_commas-2.snap similarity index 100% rename from tests/snapshots/test_basic__trailing_commas-2.snap rename to insta/tests/snapshots/test_basic__trailing_commas-2.snap diff --git a/tests/snapshots/test_basic__trailing_commas.snap b/insta/tests/snapshots/test_basic__trailing_commas.snap similarity index 100% rename from tests/snapshots/test_basic__trailing_commas.snap rename to insta/tests/snapshots/test_basic__trailing_commas.snap diff --git a/tests/snapshots/test_basic__unnamed_debug_vector-2.snap b/insta/tests/snapshots/test_basic__unnamed_debug_vector-2.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_debug_vector-2.snap rename to insta/tests/snapshots/test_basic__unnamed_debug_vector-2.snap diff --git a/tests/snapshots/test_basic__unnamed_debug_vector-3.snap b/insta/tests/snapshots/test_basic__unnamed_debug_vector-3.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_debug_vector-3.snap rename to insta/tests/snapshots/test_basic__unnamed_debug_vector-3.snap diff --git a/tests/snapshots/test_basic__unnamed_debug_vector.snap b/insta/tests/snapshots/test_basic__unnamed_debug_vector.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_debug_vector.snap rename to insta/tests/snapshots/test_basic__unnamed_debug_vector.snap diff --git a/tests/snapshots/test_basic__unnamed_display-2.snap b/insta/tests/snapshots/test_basic__unnamed_display-2.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_display-2.snap rename to insta/tests/snapshots/test_basic__unnamed_display-2.snap diff --git a/tests/snapshots/test_basic__unnamed_display.snap b/insta/tests/snapshots/test_basic__unnamed_display.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_display.snap rename to insta/tests/snapshots/test_basic__unnamed_display.snap diff --git a/tests/snapshots/test_basic__unnamed_json_vector-2.snap b/insta/tests/snapshots/test_basic__unnamed_json_vector-2.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_json_vector-2.snap rename to insta/tests/snapshots/test_basic__unnamed_json_vector-2.snap diff --git a/tests/snapshots/test_basic__unnamed_json_vector-3.snap b/insta/tests/snapshots/test_basic__unnamed_json_vector-3.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_json_vector-3.snap rename to insta/tests/snapshots/test_basic__unnamed_json_vector-3.snap diff --git a/tests/snapshots/test_basic__unnamed_json_vector.snap b/insta/tests/snapshots/test_basic__unnamed_json_vector.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_json_vector.snap rename to insta/tests/snapshots/test_basic__unnamed_json_vector.snap diff --git a/tests/snapshots/test_basic__unnamed_nested_closure.snap b/insta/tests/snapshots/test_basic__unnamed_nested_closure.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_nested_closure.snap rename to insta/tests/snapshots/test_basic__unnamed_nested_closure.snap diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap b/insta/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_yaml_vector-2.snap rename to insta/tests/snapshots/test_basic__unnamed_yaml_vector-2.snap diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap b/insta/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_yaml_vector-3.snap rename to insta/tests/snapshots/test_basic__unnamed_yaml_vector-3.snap diff --git a/tests/snapshots/test_basic__unnamed_yaml_vector.snap b/insta/tests/snapshots/test_basic__unnamed_yaml_vector.snap similarity index 100% rename from tests/snapshots/test_basic__unnamed_yaml_vector.snap rename to insta/tests/snapshots/test_basic__unnamed_yaml_vector.snap diff --git a/tests/snapshots/test_basic__yaml_vector.snap b/insta/tests/snapshots/test_basic__yaml_vector.snap similarity index 100% rename from tests/snapshots/test_basic__yaml_vector.snap rename to insta/tests/snapshots/test_basic__yaml_vector.snap diff --git a/tests/snapshots/test_bugs__crlf.snap b/insta/tests/snapshots/test_bugs__crlf.snap similarity index 100% rename from tests/snapshots/test_bugs__crlf.snap rename to insta/tests/snapshots/test_bugs__crlf.snap diff --git a/tests/snapshots/test_bugs__trailing_crlf.snap b/insta/tests/snapshots/test_bugs__trailing_crlf.snap similarity index 100% rename from tests/snapshots/test_bugs__trailing_crlf.snap rename to insta/tests/snapshots/test_bugs__trailing_crlf.snap diff --git a/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap b/insta/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap similarity index 100% rename from tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap rename to insta/tests/snapshots/test_glob__basic_globbing@goodbye.txt.snap diff --git a/tests/snapshots/test_glob__basic_globbing@hello.txt.snap b/insta/tests/snapshots/test_glob__basic_globbing@hello.txt.snap similarity index 100% rename from tests/snapshots/test_glob__basic_globbing@hello.txt.snap rename to insta/tests/snapshots/test_glob__basic_globbing@hello.txt.snap diff --git a/tests/snapshots/test_glob__basic_globbing_nested@a__file.txt.snap b/insta/tests/snapshots/test_glob__basic_globbing_nested@a__file.txt.snap similarity index 100% rename from tests/snapshots/test_glob__basic_globbing_nested@a__file.txt.snap rename to insta/tests/snapshots/test_glob__basic_globbing_nested@a__file.txt.snap diff --git a/tests/snapshots/test_glob__basic_globbing_nested@b__file.txt.snap b/insta/tests/snapshots/test_glob__basic_globbing_nested@b__file.txt.snap similarity index 100% rename from tests/snapshots/test_glob__basic_globbing_nested@b__file.txt.snap rename to insta/tests/snapshots/test_glob__basic_globbing_nested@b__file.txt.snap diff --git a/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap b/insta/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap similarity index 100% rename from tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap rename to insta/tests/snapshots/test_glob__globs_follow_links@goodbye.txt.snap diff --git a/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap b/insta/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap similarity index 100% rename from tests/snapshots/test_glob__globs_follow_links@hello.txt.snap rename to insta/tests/snapshots/test_glob__globs_follow_links@hello.txt.snap diff --git a/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap b/insta/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap similarity index 100% rename from tests/snapshots/test_inline__unnamed_thread_single_line-2.snap rename to insta/tests/snapshots/test_inline__unnamed_thread_single_line-2.snap diff --git a/tests/snapshots/test_inline__unnamed_thread_single_line.snap b/insta/tests/snapshots/test_inline__unnamed_thread_single_line.snap similarity index 100% rename from tests/snapshots/test_inline__unnamed_thread_single_line.snap rename to insta/tests/snapshots/test_inline__unnamed_thread_single_line.snap diff --git a/tests/snapshots/test_redaction__foo_bar.snap b/insta/tests/snapshots/test_redaction__foo_bar.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar.snap rename to insta/tests/snapshots/test_redaction__foo_bar.snap diff --git a/tests/snapshots/test_redaction__foo_bar_alt.snap b/insta/tests/snapshots/test_redaction__foo_bar_alt.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_alt.snap rename to insta/tests/snapshots/test_redaction__foo_bar_alt.snap diff --git a/tests/snapshots/test_redaction__foo_bar_deep.snap b/insta/tests/snapshots/test_redaction__foo_bar_deep.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_deep.snap rename to insta/tests/snapshots/test_redaction__foo_bar_deep.snap diff --git a/tests/snapshots/test_redaction__foo_bar_full_range.snap b/insta/tests/snapshots/test_redaction__foo_bar_full_range.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_full_range.snap rename to insta/tests/snapshots/test_redaction__foo_bar_full_range.snap diff --git a/tests/snapshots/test_redaction__foo_bar_range.snap b/insta/tests/snapshots/test_redaction__foo_bar_range.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_range.snap rename to insta/tests/snapshots/test_redaction__foo_bar_range.snap diff --git a/tests/snapshots/test_redaction__foo_bar_range_from.snap b/insta/tests/snapshots/test_redaction__foo_bar_range_from.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_range_from.snap rename to insta/tests/snapshots/test_redaction__foo_bar_range_from.snap diff --git a/tests/snapshots/test_redaction__foo_bar_range_to.snap b/insta/tests/snapshots/test_redaction__foo_bar_range_to.snap similarity index 100% rename from tests/snapshots/test_redaction__foo_bar_range_to.snap rename to insta/tests/snapshots/test_redaction__foo_bar_range_to.snap diff --git a/tests/snapshots/test_redaction__map_key_redaction.snap b/insta/tests/snapshots/test_redaction__map_key_redaction.snap similarity index 100% rename from tests/snapshots/test_redaction__map_key_redaction.snap rename to insta/tests/snapshots/test_redaction__map_key_redaction.snap diff --git a/tests/snapshots/test_redaction__rounded_redaction.snap b/insta/tests/snapshots/test_redaction__rounded_redaction.snap similarity index 100% rename from tests/snapshots/test_redaction__rounded_redaction.snap rename to insta/tests/snapshots/test_redaction__rounded_redaction.snap diff --git a/tests/snapshots/test_redaction__struct_array_redaction.snap b/insta/tests/snapshots/test_redaction__struct_array_redaction.snap similarity index 100% rename from tests/snapshots/test_redaction__struct_array_redaction.snap rename to insta/tests/snapshots/test_redaction__struct_array_redaction.snap diff --git a/tests/snapshots/test_redaction__user.snap b/insta/tests/snapshots/test_redaction__user.snap similarity index 100% rename from tests/snapshots/test_redaction__user.snap rename to insta/tests/snapshots/test_redaction__user.snap diff --git a/tests/snapshots/test_redaction__user_csv.snap b/insta/tests/snapshots/test_redaction__user_csv.snap similarity index 100% rename from tests/snapshots/test_redaction__user_csv.snap rename to insta/tests/snapshots/test_redaction__user_csv.snap diff --git a/tests/snapshots/test_redaction__user_json.snap b/insta/tests/snapshots/test_redaction__user_json.snap similarity index 100% rename from tests/snapshots/test_redaction__user_json.snap rename to insta/tests/snapshots/test_redaction__user_json.snap diff --git a/tests/snapshots/test_redaction__user_json_flags.snap b/insta/tests/snapshots/test_redaction__user_json_flags.snap similarity index 100% rename from tests/snapshots/test_redaction__user_json_flags.snap rename to insta/tests/snapshots/test_redaction__user_json_flags.snap diff --git a/tests/snapshots/test_redaction__user_json_flags_alt.snap b/insta/tests/snapshots/test_redaction__user_json_flags_alt.snap similarity index 100% rename from tests/snapshots/test_redaction__user_json_flags_alt.snap rename to insta/tests/snapshots/test_redaction__user_json_flags_alt.snap diff --git a/tests/snapshots/test_redaction__user_json_settings.snap b/insta/tests/snapshots/test_redaction__user_json_settings.snap similarity index 100% rename from tests/snapshots/test_redaction__user_json_settings.snap rename to insta/tests/snapshots/test_redaction__user_json_settings.snap diff --git a/tests/snapshots/test_redaction__user_json_settings_callback.snap b/insta/tests/snapshots/test_redaction__user_json_settings_callback.snap similarity index 100% rename from tests/snapshots/test_redaction__user_json_settings_callback.snap rename to insta/tests/snapshots/test_redaction__user_json_settings_callback.snap diff --git a/tests/snapshots/test_redaction__user_ron.snap b/insta/tests/snapshots/test_redaction__user_ron.snap similarity index 100% rename from tests/snapshots/test_redaction__user_ron.snap rename to insta/tests/snapshots/test_redaction__user_ron.snap diff --git a/tests/snapshots/test_redaction__user_toml.snap b/insta/tests/snapshots/test_redaction__user_toml.snap similarity index 100% rename from tests/snapshots/test_redaction__user_toml.snap rename to insta/tests/snapshots/test_redaction__user_toml.snap diff --git a/tests/snapshots/test_redaction__with_random_value_and_match_comma-2.snap b/insta/tests/snapshots/test_redaction__with_random_value_and_match_comma-2.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_and_match_comma-2.snap rename to insta/tests/snapshots/test_redaction__with_random_value_and_match_comma-2.snap diff --git a/tests/snapshots/test_redaction__with_random_value_and_match_comma.snap b/insta/tests/snapshots/test_redaction__with_random_value_and_match_comma.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_and_match_comma.snap rename to insta/tests/snapshots/test_redaction__with_random_value_and_match_comma.snap diff --git a/tests/snapshots/test_redaction__with_random_value_and_trailing_comma_match.snap b/insta/tests/snapshots/test_redaction__with_random_value_and_trailing_comma_match.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_and_trailing_comma_match.snap rename to insta/tests/snapshots/test_redaction__with_random_value_and_trailing_comma_match.snap diff --git a/tests/snapshots/test_redaction__with_random_value_csv_match.snap b/insta/tests/snapshots/test_redaction__with_random_value_csv_match.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_csv_match.snap rename to insta/tests/snapshots/test_redaction__with_random_value_csv_match.snap diff --git a/tests/snapshots/test_redaction__with_random_value_json_match.snap b/insta/tests/snapshots/test_redaction__with_random_value_json_match.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_json_match.snap rename to insta/tests/snapshots/test_redaction__with_random_value_json_match.snap diff --git a/tests/snapshots/test_redaction__with_random_value_json_settings2.snap b/insta/tests/snapshots/test_redaction__with_random_value_json_settings2.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_json_settings2.snap rename to insta/tests/snapshots/test_redaction__with_random_value_json_settings2.snap diff --git a/tests/snapshots/test_redaction__with_random_value_ron_match.snap b/insta/tests/snapshots/test_redaction__with_random_value_ron_match.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_ron_match.snap rename to insta/tests/snapshots/test_redaction__with_random_value_ron_match.snap diff --git a/tests/snapshots/test_redaction__with_random_value_toml_match.snap b/insta/tests/snapshots/test_redaction__with_random_value_toml_match.snap similarity index 100% rename from tests/snapshots/test_redaction__with_random_value_toml_match.snap rename to insta/tests/snapshots/test_redaction__with_random_value_toml_match.snap diff --git a/tests/snapshots/test_settings__snapshot_with_description.snap b/insta/tests/snapshots/test_settings__snapshot_with_description.snap similarity index 100% rename from tests/snapshots/test_settings__snapshot_with_description.snap rename to insta/tests/snapshots/test_settings__snapshot_with_description.snap diff --git a/tests/snapshots/test_settings__snapshot_with_description_and_info.snap b/insta/tests/snapshots/test_settings__snapshot_with_description_and_info.snap similarity index 100% rename from tests/snapshots/test_settings__snapshot_with_description_and_info.snap rename to insta/tests/snapshots/test_settings__snapshot_with_description_and_info.snap diff --git a/tests/snapshots/test_settings__snapshot_with_description_and_raw_info.snap b/insta/tests/snapshots/test_settings__snapshot_with_description_and_raw_info.snap similarity index 100% rename from tests/snapshots/test_settings__snapshot_with_description_and_raw_info.snap rename to insta/tests/snapshots/test_settings__snapshot_with_description_and_raw_info.snap diff --git a/tests/snapshots/test_suffixes__basic_suffixes@1.snap b/insta/tests/snapshots/test_suffixes__basic_suffixes@1.snap similarity index 100% rename from tests/snapshots/test_suffixes__basic_suffixes@1.snap rename to insta/tests/snapshots/test_suffixes__basic_suffixes@1.snap diff --git a/tests/snapshots/test_suffixes__basic_suffixes@2.snap b/insta/tests/snapshots/test_suffixes__basic_suffixes@2.snap similarity index 100% rename from tests/snapshots/test_suffixes__basic_suffixes@2.snap rename to insta/tests/snapshots/test_suffixes__basic_suffixes@2.snap diff --git a/tests/snapshots/test_suffixes__basic_suffixes@3.snap b/insta/tests/snapshots/test_suffixes__basic_suffixes@3.snap similarity index 100% rename from tests/snapshots/test_suffixes__basic_suffixes@3.snap rename to insta/tests/snapshots/test_suffixes__basic_suffixes@3.snap diff --git a/tests/snapshots2/test_settings__snapshot_path.snap b/insta/tests/snapshots2/test_settings__snapshot_path.snap similarity index 100% rename from tests/snapshots2/test_settings__snapshot_path.snap rename to insta/tests/snapshots2/test_settings__snapshot_path.snap diff --git a/tests/test_allow_duplicates.rs b/insta/tests/test_allow_duplicates.rs similarity index 100% rename from tests/test_allow_duplicates.rs rename to insta/tests/test_allow_duplicates.rs diff --git a/tests/test_basic.rs b/insta/tests/test_basic.rs similarity index 100% rename from tests/test_basic.rs rename to insta/tests/test_basic.rs diff --git a/tests/test_bugs.rs b/insta/tests/test_bugs.rs similarity index 100% rename from tests/test_bugs.rs rename to insta/tests/test_bugs.rs diff --git a/tests/test_clash_detection.rs b/insta/tests/test_clash_detection.rs similarity index 100% rename from tests/test_clash_detection.rs rename to insta/tests/test_clash_detection.rs diff --git a/tests/test_filters.rs b/insta/tests/test_filters.rs similarity index 100% rename from tests/test_filters.rs rename to insta/tests/test_filters.rs diff --git a/tests/test_glob.rs b/insta/tests/test_glob.rs similarity index 100% rename from tests/test_glob.rs rename to insta/tests/test_glob.rs diff --git a/tests/test_inline.rs b/insta/tests/test_inline.rs similarity index 100% rename from tests/test_inline.rs rename to insta/tests/test_inline.rs diff --git a/tests/test_redaction.rs b/insta/tests/test_redaction.rs similarity index 100% rename from tests/test_redaction.rs rename to insta/tests/test_redaction.rs diff --git a/tests/test_settings.rs b/insta/tests/test_settings.rs similarity index 100% rename from tests/test_settings.rs rename to insta/tests/test_settings.rs diff --git a/tests/test_suffixes.rs b/insta/tests/test_suffixes.rs similarity index 100% rename from tests/test_suffixes.rs rename to insta/tests/test_suffixes.rs diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 97557c87..346262f9 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -7,8 +7,9 @@ cd $SCRIPT_DIR/.. NEW_VERSION="${1}" echo "Bumping version: ${NEW_VERSION}" -perl -pi -e "s/^version = \".*?\"/version = \"$NEW_VERSION\"/" Cargo.toml +perl -pi -e "s/^version = \".*?\"/version = \"$NEW_VERSION\"/" insta/Cargo.toml perl -pi -e "s/^version = \".*?\"/version = \"$NEW_VERSION\"/" cargo-insta/Cargo.toml perl -pi -e "s/^(insta.*?)version = \".*?\"/\$1version = \"=$NEW_VERSION\"/" cargo-insta/Cargo.toml +cargo check -p insta cargo check -p cargo-insta