diff --git a/Cargo.lock b/Cargo.lock index dcf13ce8..d8588a9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,6 +160,18 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "console" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -276,12 +288,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" -[[package]] -name = "dissimilar" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" - [[package]] name = "either" version = "1.13.0" @@ -289,20 +295,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] -name = "equivalent" -version = "1.0.1" +name = "encode_unicode" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] -name = "expect-test" -version = "1.5.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63af43ff4431e848fb47472a920f14fa71c24de13255a5692e93d4e90302acb0" -dependencies = [ - "dissimilar", - "once_cell", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fancy-regex" @@ -376,6 +378,18 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "insta" +version = "1.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" +dependencies = [ + "console", + "linked-hash-map", + "once_cell", + "similar", +] + [[package]] name = "itertools" version = "0.10.5" @@ -764,6 +778,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "similar" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" + [[package]] name = "syn" version = "1.0.109" @@ -793,11 +813,11 @@ dependencies = [ "bincode", "bitflags", "criterion", - "expect-test", "fancy-regex", "flate2", "fnv", "getopts", + "insta", "once_cell", "onig", "plist", diff --git a/Cargo.toml b/Cargo.toml index 62abe611..1d8ca0b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ pretty_assertions = "0.6" rustup-toolchain = "0.1.5" rustdoc-json = "0.8.8" public-api = "0.33.1" -expect-test = "1.4.1" +insta = "1.42.0" [features] diff --git a/tests/public_api.rs b/tests/public_api.rs index 1568863c..60c333b3 100644 --- a/tests/public_api.rs +++ b/tests/public_api.rs @@ -24,5 +24,5 @@ fn public_api() { .unwrap(); // Assert that the public API looks correct - expect_test::expect_file!["public-api.txt"].assert_eq(&public_api.to_string()); + insta::assert_snapshot!(public_api); } diff --git a/tests/public-api.txt b/tests/snapshots/public_api__public_api.snap similarity index 99% rename from tests/public-api.txt rename to tests/snapshots/public_api__public_api.snap index 3a40ce23..f2bf1133 100644 --- a/tests/public-api.txt +++ b/tests/snapshots/public_api__public_api.snap @@ -1,3 +1,7 @@ +--- +source: tests/public_api.rs +expression: public_api +--- pub mod syntect pub mod syntect::dumps pub fn syntect::dumps::dump_binary(o: &T) -> alloc::vec::Vec