diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd4c3608..8f2a1c59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,4 +36,4 @@ jobs: with: toolchain: 1.51.0 - name: Check - run: cargo check --no-default-features + run: cargo check -p insta --no-default-features diff --git a/Cargo.toml b/Cargo.toml index 70fec999..9fb5b236 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,67 +1,4 @@ -[package] -name = "insta" -version = "1.33.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"] -readme = "README.md" -exclude = [ - "assets/*" -] +[workspace] +members = ["cargo-insta", "insta"] -[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"] } -yaml-rust = "0.4.5" -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" +resolver = "2" diff --git a/Makefile b/Makefile index b73d1353..e2aa03c4 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,13 @@ cargotest: @cargo test --all-features @cargo test --no-default-features @cargo test --features redactions -- --test-threads 1 - @cd cargo-insta; cargo test 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.lock b/cargo-insta/Cargo.lock deleted file mode 100644 index 3422c5a4..00000000 --- a/cargo-insta/Cargo.lock +++ /dev/null @@ -1,887 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" -dependencies = [ - "memchr", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "memchr", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-insta" -version = "1.33.0" -dependencies = [ - "cargo_metadata", - "console", - "ignore", - "insta", - "proc-macro2", - "serde", - "serde_json", - "structopt", - "syn", - "tempfile", - "uuid", -] - -[[package]] -name = "cargo-platform" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb9ac64500cc83ce4b9f8dafa78186aa008c8dea77a09b94cd307fd0cd5022a8" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "bitflags", - "textwrap", - "unicode-width", -] - -[[package]] -name = "console" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b6515d269224923b26b5febea2ed42b2d5f2ce37284a4dd670fedd6cb8347a" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.42.0", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "digest" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "globset" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "ignore" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" -dependencies = [ - "crossbeam-utils", - "globset", - "lazy_static", - "log", - "memchr", - "regex", - "same-file", - "thread_local", - "walkdir", - "winapi-util", -] - -[[package]] -name = "insta" -version = "1.33.0" -dependencies = [ - "console", - "lazy_static", - "linked-hash-map", - "pest", - "pest_derive", - "serde", - "similar", - "yaml-rust", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "once_cell" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" - -[[package]] -name = "pest" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6" -dependencies = [ - "once_cell", - "pest", - "sha1", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "rustix" -version = "0.37.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "semver" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "similar" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" - -[[package]] -name = "structopt" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "syn" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.45.0", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - -[[package]] -name = "unicode-ident" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" - -[[package]] -name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "uuid" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" -dependencies = [ - "getrandom", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -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-insta/Cargo.toml b/cargo-insta/Cargo.toml index 3eff7ae4..f8b2861f 100644 --- a/cargo-insta/Cargo.toml +++ b/cargo-insta/Cargo.toml @@ -12,7 +12,12 @@ edition = "2018" readme = "README.md" [dependencies] -insta = { version = "=1.33.0", path = "..", features = ["json", "yaml", "redactions", "_cargo_insta_internal"] } +insta = { version = "=1.33.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/integration-tests/Cargo.toml b/cargo-insta/integration-tests/Cargo.toml index 1163e476..3b43aee5 100644 --- a/cargo-insta/integration-tests/Cargo.toml +++ b/cargo-insta/integration-tests/Cargo.toml @@ -8,6 +8,11 @@ edition = "2018" [dependencies] dircpy = "0.3.4" -insta = { path = "../..", features = ["json", "yaml", "redactions", "glob"] } +insta = { path = "../../insta", features = [ + "json", + "yaml", + "redactions", + "glob", +] } walkdir = "2.3.1" serde = { version = "1.0.117", features = ["derive"] } diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index 444729c6..936fd546 100644 --- a/cargo-insta/src/cli.rs +++ b/cargo-insta/src/cli.rs @@ -45,6 +45,7 @@ struct Opts { bin_name = "cargo insta", after_help = "For the online documentation of the latest version, see https://insta.rs/docs/cli/." )] +#[allow(clippy::large_enum_variant)] enum Command { /// Interactively review snapshots #[structopt(name = "review", alias = "verify")] @@ -415,6 +416,7 @@ fn handle_target_args(target_args: &TargetArgs) -> Result, Box< } } +#[allow(clippy::type_complexity)] fn load_snapshot_containers<'a>( loc: &'a LocationInfo, ) -> Result< @@ -775,6 +777,7 @@ fn handle_unreferenced_snapshots( Ok(()) } +#[allow(clippy::type_complexity)] fn prepare_test_runner<'snapshot_ref>( test_runner: TestRunner, unreferenced: UnreferencedSnapshots, diff --git a/cargo-insta/src/inline.rs b/cargo-insta/src/inline.rs index 1142e451..48c43f16 100644 --- a/cargo-insta/src/inline.rs +++ b/cargo-insta/src/inline.rs @@ -104,7 +104,7 @@ impl FilePatcher { // replace lines let snapshot_line_contents = - vec![prefix, snapshot.to_inline(inline.indentation), suffix].join(""); + [prefix, snapshot.to_inline(inline.indentation), suffix].join(""); self.lines.splice( inline.start.0..=inline.end.0, diff --git a/insta/Cargo.toml b/insta/Cargo.toml new file mode 100644 index 00000000..a0438d52 --- /dev/null +++ b/insta/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "insta" +version = "1.33.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"] +readme = "README.md" + +[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"] } +yaml-rust = "0.4.5" +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" 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.rs b/insta/src/content/yaml.rs similarity index 100% rename from src/content/yaml.rs rename to insta/src/content/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 100% rename from src/runtime.rs rename to insta/src/runtime.rs 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__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__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_single_line-2.snap b/insta/tests/snapshots/test_inline__unnamed_single_line-2.snap similarity index 100% rename from tests/snapshots/test_inline__unnamed_single_line-2.snap rename to insta/tests/snapshots/test_inline__unnamed_single_line-2.snap diff --git a/tests/snapshots/test_inline__unnamed_single_line.snap b/insta/tests/snapshots/test_inline__unnamed_single_line.snap similarity index 100% rename from tests/snapshots/test_inline__unnamed_single_line.snap rename to insta/tests/snapshots/test_inline__unnamed_single_line.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_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_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 45317f41..592c85cf 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -1,14 +1,14 @@ #!/bin/bash set -euo pipefail -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 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 -cd cargo-insta; cargo check +cargo check diff --git a/scripts/publish-all.sh b/scripts/publish-all.sh index 6a49bb18..faf37545 100755 --- a/scripts/publish-all.sh +++ b/scripts/publish-all.sh @@ -1,8 +1,8 @@ #!/bin/bash set -euo pipefail -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd $SCRIPT_DIR/.. cargo publish -p insta -cd cargo-insta && cargo publish +cargo publish -p insta-insta