diff --git a/Cargo.lock b/Cargo.lock index 0191d358..9a0e460c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -26,21 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anstream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" -dependencies = [ - "anstyle", - "anstyle-parse 0.2.7", - "anstyle-query", - "anstyle-wincon 1.0.2", - "colorchoice", - "is-terminal", - "utf8parse", -] - [[package]] name = "anstream" version = "1.0.0" @@ -48,9 +33,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", - "anstyle-parse 1.0.0", + "anstyle-parse", "anstyle-query", - "anstyle-wincon 3.0.11", + "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", @@ -58,9 +43,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-lossy" @@ -71,15 +56,6 @@ dependencies = [ "anstyle", ] -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - [[package]] name = "anstyle-parse" version = "1.0.0" @@ -95,32 +71,22 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-svg" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf4c73d20df989165d5a9a34f06c2d5102f1728ae395021c6835a25e03416a2" +checksum = "db7ec5fa88fc0837393f6b110b0764aeb0a673952bc91300628641dd0fffbf85" dependencies = [ "anstyle", "anstyle-lossy", - "anstyle-parse 1.0.0", + "anstyle-parse", "html-escape", "unicode-width", ] -[[package]] -name = "anstyle-wincon" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" -dependencies = [ - "anstyle", - "windows-sys 0.48.0", -] - [[package]] name = "anstyle-wincon" version = "3.0.11" @@ -129,20 +95,20 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] -name = "autocfg" -version = "1.5.0" +name = "anyhow" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "automod" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb4bd301db2e2ca1f5be131c24eb8ebf2d9559bc3744419e93baf8ddea7e670" +checksum = "e8b5778837666541195063243828c5b6139221b47dc4ec3ba81738e532469ab1" dependencies = [ "proc-macro2", "quote", @@ -161,7 +127,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -172,9 +138,9 @@ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bstr" -version = "1.10.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", "serde", @@ -188,22 +154,21 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "clap" -version = "4.3.24" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.24" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ - "anstream 0.3.2", + "anstream", "anstyle", "clap_lex", "strsim", @@ -211,9 +176,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" dependencies = [ "heck", "proc-macro2", @@ -223,9 +188,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "colorchoice" @@ -307,7 +272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -318,12 +283,11 @@ checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" [[package]] name = "escargot" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f351750780493fc33fa0ce8ba3c7d61f9736cfa3b3bb9ee2342643ffe40211" +checksum = "11c3aea32bc97b500c9ca6a72b768a26e558264303d101d3409cf6d57a9ed0cf" dependencies = [ "log", - "once_cell", "serde", "serde_json", ] @@ -345,16 +309,23 @@ dependencies = [ "libredox", ] +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "getrandom" -version = "0.3.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", "r-efi", "wasip2", + "wasip3", ] [[package]] @@ -371,9 +342,9 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "globset" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" dependencies = [ "aho-corasick", "bstr", @@ -384,27 +355,24 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.5.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "html-escape" @@ -431,81 +399,63 @@ dependencies = [ "serde", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata", "same-file", - "thread_local", "walkdir", "winapi-util", ] [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.11.4" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown 0.16.0", -] - -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.60.2", + "hashbrown 0.16.1", + "serde", + "serde_core", ] [[package]] name = "is_terminal_polyfill" -version = "1.48.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2736dd548daf35f50d261bbad35a83890bb9b461797f15de528485fbf206ab15" -dependencies = [ - "is-terminal", -] +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] -name = "lazy_static" -version = "1.5.0" +name = "leb128fmt" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.182" +version = "0.2.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libredox" @@ -521,14 +471,14 @@ dependencies = [ [[package]] name = "libtest-mimic" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58" +checksum = "14e6ba06f0ade6e504aff834d7c34298e5155c6baca353cc6a4aaff2f9fd7f33" dependencies = [ + "anstream", + "anstyle", "clap", "escape8259", - "termcolor", - "threadpool", ] [[package]] @@ -545,9 +495,9 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" @@ -570,16 +520,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" version = "0.36.7" @@ -591,18 +531,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" -version = "1.56.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aab899efe6ce4fe821f6dda30c02d7041c79f147598ab4b60197f181e12d001" -dependencies = [ - "once_cell", -] +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "os_pipe" @@ -620,35 +557,45 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.41" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -656,9 +603,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -673,6 +620,26 @@ dependencies = [ "bitflags", ] +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "regex" version = "1.12.3" @@ -718,15 +685,9 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - [[package]] name = "same-file" version = "1.0.6" @@ -738,12 +699,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.22" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ "dyn-clone", - "indexmap 1.9.3", + "ref-cast", "schemars_derive", "serde", "serde_json", @@ -751,9 +712,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.22" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" dependencies = [ "proc-macro2", "quote", @@ -761,6 +722,12 @@ dependencies = [ "syn", ] +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + [[package]] name = "serde" version = "1.0.228" @@ -804,22 +771,23 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ + "indexmap", "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] name = "serde_spanned" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2789234a13a53fc4be1b51ea1bab45a3c338bdb884862a257d10e5a74ae009e6" +checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98" dependencies = [ "serde_core", ] @@ -840,7 +808,7 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" name = "snapbox" version = "1.1.0" dependencies = [ - "anstream 1.0.0", + "anstream", "anstyle", "anstyle-svg", "automod", @@ -861,27 +829,27 @@ dependencies = [ "tempfile", "wait-timeout", "walkdir", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "snapbox-macros" version = "1.0.1" dependencies = [ - "anstream 1.0.0", + "anstream", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.106" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -890,60 +858,33 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.26.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", "getrandom", "once_cell", "rustix", - "windows-sys 0.60.2", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thread_local" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", + "windows-sys 0.61.2", ] [[package]] name = "toml_datetime" -version = "0.7.1" +version = "1.1.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a197c0ec7d131bfc6f7e82c8442ba1595aeab35da7adbf05b6b73cd06a16b6be" +checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.5" +version = "0.25.7+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ad0b7ae9cfeef5605163839cb9221f453399f15cfb5c10be9885fcf56611f9" +checksum = "d15b06e6c39068c203e7c1d0bc3944796d867449e7668ef7fa5ea43727cb846e" dependencies = [ - "indexmap 2.11.4", + "indexmap", "serde_core", "serde_spanned", "toml_datetime", @@ -954,24 +895,24 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.2" +version = "1.1.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.0.2" +version = "1.1.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed" [[package]] name = "trycmd" version = "1.1.1" dependencies = [ - "anstream 1.0.0", + "anstream", "automod", "escargot", "glob", @@ -997,9 +938,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-width" @@ -1007,6 +948,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "utf8-width" version = "0.1.8" @@ -1040,108 +987,104 @@ dependencies = [ [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.46.0", ] [[package]] -name = "winapi-util" -version = "0.1.11" +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "windows-sys 0.60.2", + "wit-bindgen 0.51.0", ] [[package]] -name = "windows-link" -version = "0.2.1" +name = "wasm-encoder" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "wasm-metadata" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ - "windows-targets 0.48.5", + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", ] [[package]] -name = "windows-sys" -version = "0.59.0" +name = "wasmparser" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "windows-targets 0.52.6", + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", ] [[package]] -name = "windows-sys" -version = "0.60.2" +name = "winapi-util" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-targets 0.53.5", + "windows-sys 0.61.2", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-link" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "windows-targets" -version = "0.52.6" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.53.5" +name = "windows-sys" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] [[package]] name = "windows_aarch64_gnullvm" @@ -1149,66 +1092,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -1216,76 +1117,128 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_i686_msvc" -version = "0.53.1" +name = "windows_x86_64_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" +name = "windows_x86_64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_gnu" +name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" +name = "winnow" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" +checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +dependencies = [ + "memchr", +] [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" +name = "wit-bindgen" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] [[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" +name = "wit-bindgen-core" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "wit-bindgen-rust" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" +name = "wit-bindgen-rust-macro" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" +name = "wit-component" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] [[package]] -name = "winnow" -version = "0.7.13" +name = "wit-parser" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ - "memchr", + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", ] [[package]] -name = "wit-bindgen" -version = "0.51.0" +name = "zmij" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 5aeb331a..e80aa1cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] members = ["crates/*"] -resolver = "2" +resolver = "3" [workspace.package] repository = "https://github.com/assert-rs/snapbox/" license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.66" # MSRV +edition = "2024" +rust-version = "1.85" # MSRV include = [ "build.rs", "src/**/*", diff --git a/crates/snapbox/Cargo.toml b/crates/snapbox/Cargo.toml index b8ddd7aa..ca333f90 100644 --- a/crates/snapbox/Cargo.toml +++ b/crates/snapbox/Cargo.toml @@ -69,37 +69,37 @@ snapbox-macros = { path = "../snapbox-macros", version = "1.0.1" } content_inspector = { version = "0.2.4", optional = true } -tempfile = { version = "3.26", optional = true } +tempfile = { version = "3.27", optional = true } walkdir = { version = "2.5.0", optional = true } dunce = { version = "1.0", optional = true } filetime = { version = "0.2.27", optional = true } os_pipe = { version = "1.2", optional = true } wait-timeout = { version = "0.2.1", optional = true } -escargot = { version = "0.5.14", optional = true } +escargot = { version = "0.5.15", optional = true } backtrace = { version = "0.3", optional = true } similar = { version = "2.7.0", features = ["inline"], optional = true } -anstyle = "1.0.13" +anstyle = "1.0.14" anstream = { version = "1.0.0", optional = true } document-features = { version = "0.2.12", optional = true } -serde_json = { version = "1.0.145", optional = true} -anstyle-svg = { version = "1.0.0", optional = true } +serde_json = { version = "1.0.149", optional = true} +anstyle-svg = { version = "1.1.0", optional = true } serde = { version = "1.0.228", optional = true } regex = { version = "1.12.3", optional = true, default-features = false, features = ["std"] } [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.60.2", features = ["Win32_Foundation"], optional = true } +windows-sys = { version = "0.61.2", features = ["Win32_Foundation"], optional = true } [target.'cfg(unix)'.dependencies] -libc = { version = "0.2.182", optional = true } +libc = { version = "0.2.183", optional = true } [dev-dependencies] -automod = "1.0.15" +automod = "1.0.16" [[example]] name = "diff" diff --git a/crates/snapbox/src/assert/mod.rs b/crates/snapbox/src/assert/mod.rs index 965b09c2..ccf4b35c 100644 --- a/crates/snapbox/src/assert/mod.rs +++ b/crates/snapbox/src/assert/mod.rs @@ -8,8 +8,8 @@ use anstream::stderr; #[cfg(not(feature = "color"))] use std::io::stderr; -use crate::filter::{Filter as _, FilterNewlines, FilterPaths, NormalizeToExpected}; use crate::IntoData; +use crate::filter::{Filter as _, FilterNewlines, FilterPaths, NormalizeToExpected}; pub use action::Action; pub use action::DEFAULT_ACTION_ENV; @@ -113,7 +113,7 @@ impl Assert { mut actual: crate::Data, mut expected: crate::Data, ) -> (crate::Data, crate::Data) { - if expected.filters.is_newlines_set() { + if expected.inner.filters.is_newlines_set() { expected = FilterNewlines.filter(expected); } @@ -121,18 +121,18 @@ impl Assert { actual = actual.coerce_to(expected.against_format()); actual = actual.coerce_to(expected.intended_format()); - if self.normalize_paths && expected.filters.is_paths_set() { + if self.normalize_paths && expected.inner.filters.is_paths_set() { actual = FilterPaths.filter(actual); } - if expected.filters.is_newlines_set() { + if expected.inner.filters.is_newlines_set() { actual = FilterNewlines.filter(actual); } let mut normalize = NormalizeToExpected::new(); - if expected.filters.is_redaction_set() { + if expected.inner.filters.is_redaction_set() { normalize = normalize.redact_with(&self.substitutions); } - if expected.filters.is_unordered_set() { + if expected.inner.filters.is_unordered_set() { normalize = normalize.unordered(); } actual = normalize.normalize(actual, &expected); diff --git a/crates/snapbox/src/data/mod.rs b/crates/snapbox/src/data/mod.rs index df2512d0..942ee310 100644 --- a/crates/snapbox/src/data/mod.rs +++ b/crates/snapbox/src/data/mod.rs @@ -379,13 +379,18 @@ macro_rules! str { /// This provides conveniences for tracking the intended format (binary vs text). #[derive(Clone, Debug)] pub struct Data { - pub(crate) inner: DataInner, + pub(crate) inner: Box, +} + +#[derive(Clone, Debug)] +pub(crate) struct DataInner { + pub(crate) value: DataValue, pub(crate) source: Option, pub(crate) filters: FilterSet, } #[derive(Clone, Debug)] -pub(crate) enum DataInner { +pub(crate) enum DataValue { Error(DataError), Binary(Vec), Text(String), @@ -410,26 +415,26 @@ pub(crate) enum DataInner { impl Data { /// Mark the data as binary (no post-processing) pub fn binary(raw: impl Into>) -> Self { - Self::with_inner(DataInner::Binary(raw.into())) + Self::with_value(DataValue::Binary(raw.into())) } /// Mark the data as text (post-processing) pub fn text(raw: impl Into) -> Self { - Self::with_inner(DataInner::Text(raw.into())) + Self::with_value(DataValue::Text(raw.into())) } #[cfg(feature = "json")] pub fn json(raw: impl Into) -> Self { - Self::with_inner(DataInner::Json(raw.into())) + Self::with_value(DataValue::Json(raw.into())) } #[cfg(feature = "json")] pub fn jsonlines(raw: impl Into>) -> Self { - Self::with_inner(DataInner::JsonLines(serde_json::Value::Array(raw.into()))) + Self::with_value(DataValue::JsonLines(serde_json::Value::Array(raw.into()))) } fn error(raw: impl Into, intended: DataFormat) -> Self { - Self::with_inner(DataInner::Error(DataError { + Self::with_value(DataValue::Error(DataError { error: raw.into(), intended, })) @@ -451,13 +456,13 @@ impl Data { /// Remove default [`filters`][crate::filter] from this `expected` result pub fn raw(mut self) -> Self { - self.filters = FilterSet::empty().newlines(); + self.inner.filters = FilterSet::empty().newlines(); self } /// Treat lines and json arrays as unordered pub fn unordered(mut self) -> Self { - self.filters = self.filters.unordered(); + self.inner.filters = self.inner.filters.unordered(); self } } @@ -466,16 +471,18 @@ impl Data { /// /// For example, see [`OutputAssert`][crate::cmd::OutputAssert] impl Data { - pub(crate) fn with_inner(inner: DataInner) -> Self { + pub(crate) fn with_value(value: DataValue) -> Self { Self { - inner, - source: None, - filters: FilterSet::new(), + inner: Box::new(DataInner { + value, + source: None, + filters: FilterSet::new(), + }), } } fn with_source(mut self, source: impl Into) -> Self { - self.source = Some(source.into()); + self.inner.source = Some(source.into()); self } @@ -536,30 +543,30 @@ impl Data { /// /// Note: this will not inspect binary data for being a valid `String`. pub fn render(&self) -> Option { - match &self.inner { - DataInner::Error(_) => None, - DataInner::Binary(_) => None, - DataInner::Text(data) => Some(data.to_owned()), + match &self.inner.value { + DataValue::Error(_) => None, + DataValue::Binary(_) => None, + DataValue::Text(data) => Some(data.to_owned()), #[cfg(feature = "json")] - DataInner::Json(_) => Some(self.to_string()), + DataValue::Json(_) => Some(self.to_string()), #[cfg(feature = "json")] - DataInner::JsonLines(_) => Some(self.to_string()), + DataValue::JsonLines(_) => Some(self.to_string()), #[cfg(feature = "term-svg")] - DataInner::TermSvg(data) => Some(data.to_owned()), + DataValue::TermSvg(data) => Some(data.to_owned()), } } pub fn to_bytes(&self) -> crate::assert::Result> { - match &self.inner { - DataInner::Error(err) => Err(err.error.clone()), - DataInner::Binary(data) => Ok(data.clone()), - DataInner::Text(data) => Ok(data.clone().into_bytes()), + match &self.inner.value { + DataValue::Error(err) => Err(err.error.clone()), + DataValue::Binary(data) => Ok(data.clone()), + DataValue::Text(data) => Ok(data.clone().into_bytes()), #[cfg(feature = "json")] - DataInner::Json(_) => Ok(self.to_string().into_bytes()), + DataValue::Json(_) => Ok(self.to_string().into_bytes()), #[cfg(feature = "json")] - DataInner::JsonLines(_) => Ok(self.to_string().into_bytes()), + DataValue::JsonLines(_) => Ok(self.to_string().into_bytes()), #[cfg(feature = "term-svg")] - DataInner::TermSvg(data) => Ok(data.clone().into_bytes()), + DataValue::TermSvg(data) => Ok(data.clone().into_bytes()), } } @@ -567,19 +574,21 @@ impl Data { /// /// This is generally used for `expected` data pub fn is(self, format: DataFormat) -> Self { - let filters = self.filters; - let source = self.source.clone(); + let filters = self.inner.filters; + let source = self.inner.source.clone(); match self.try_is(format) { Ok(new) => new, Err(err) => { - let inner = DataInner::Error(DataError { + let value = DataValue::Error(DataError { error: err, intended: format, }); Self { - inner, - source, - filters, + inner: Box::new(DataInner { + value, + source, + filters, + }), } } } @@ -587,44 +596,44 @@ impl Data { fn try_is(self, format: DataFormat) -> crate::assert::Result { let original = self.format(); - let source = self.source; - let filters = self.filters; - let inner = match (self.inner, format) { - (DataInner::Error(inner), _) => DataInner::Error(inner), - (DataInner::Binary(inner), DataFormat::Binary) => DataInner::Binary(inner), - (DataInner::Text(inner), DataFormat::Text) => DataInner::Text(inner), + let source = self.inner.source; + let filters = self.inner.filters; + let value = match (self.inner.value, format) { + (DataValue::Error(inner), _) => DataValue::Error(inner), + (DataValue::Binary(inner), DataFormat::Binary) => DataValue::Binary(inner), + (DataValue::Text(inner), DataFormat::Text) => DataValue::Text(inner), #[cfg(feature = "json")] - (DataInner::Json(inner), DataFormat::Json) => DataInner::Json(inner), + (DataValue::Json(inner), DataFormat::Json) => DataValue::Json(inner), #[cfg(feature = "json")] - (DataInner::JsonLines(inner), DataFormat::JsonLines) => DataInner::JsonLines(inner), + (DataValue::JsonLines(inner), DataFormat::JsonLines) => DataValue::JsonLines(inner), #[cfg(feature = "term-svg")] - (DataInner::TermSvg(inner), DataFormat::TermSvg) => DataInner::TermSvg(inner), - (DataInner::Binary(inner), _) => { - let inner = String::from_utf8(inner).map_err(|_err| "invalid UTF-8".to_owned())?; - Self::text(inner).try_is(format)?.inner + (DataValue::TermSvg(inner), DataFormat::TermSvg) => DataValue::TermSvg(inner), + (DataValue::Binary(inner), _) => { + let value = String::from_utf8(inner).map_err(|_err| "invalid UTF-8".to_owned())?; + Self::text(value).try_is(format)?.inner.value } #[cfg(feature = "json")] - (DataInner::Text(inner), DataFormat::Json) => { - let inner = serde_json::from_str::(&inner) + (DataValue::Text(inner), DataFormat::Json) => { + let value = serde_json::from_str::(&inner) .map_err(|err| err.to_string())?; - DataInner::Json(inner) + DataValue::Json(value) } #[cfg(feature = "json")] - (DataInner::Text(inner), DataFormat::JsonLines) => { - let inner = parse_jsonlines(&inner).map_err(|err| err.to_string())?; - DataInner::JsonLines(serde_json::Value::Array(inner)) + (DataValue::Text(inner), DataFormat::JsonLines) => { + let value = parse_jsonlines(&inner).map_err(|err| err.to_string())?; + DataValue::JsonLines(serde_json::Value::Array(value)) } #[cfg(feature = "term-svg")] - (DataInner::Text(inner), DataFormat::TermSvg) => DataInner::TermSvg(inner), - (inner, DataFormat::Binary) => { - let remake = Self::with_inner(inner); - DataInner::Binary(remake.to_bytes().expect("error case handled")) + (DataValue::Text(inner), DataFormat::TermSvg) => DataValue::TermSvg(inner), + (value, DataFormat::Binary) => { + let remake = Self::with_value(value); + DataValue::Binary(remake.to_bytes().expect("error case handled")) } // This variant is already covered unless structured data is enabled #[cfg(feature = "structured-data")] - (inner, DataFormat::Text) => { - if let Some(str) = Self::with_inner(inner).render() { - DataInner::Text(str) + (value, DataFormat::Text) => { + if let Some(str) = Self::with_value(value).render() { + DataValue::Text(str) } else { return Err(format!("cannot convert {original:?} to {format:?}").into()); } @@ -632,9 +641,11 @@ impl Data { (_, _) => return Err(format!("cannot convert {original:?} to {format:?}").into()), }; Ok(Self { - inner, - source, - filters, + inner: Box::new(DataInner { + value, + source, + filters, + }), }) } @@ -657,7 +668,7 @@ impl Data { /// # } /// ``` fn against(mut self, format: DataFormat) -> Data { - self.filters = self.filters.against(format); + self.inner.filters = self.inner.filters.against(format); self } @@ -665,26 +676,26 @@ impl Data { /// /// This is generally used on `actual` data to make it match `expected` pub fn coerce_to(self, format: DataFormat) -> Self { - let source = self.source; - let filters = self.filters; - let inner = match (self.inner, format) { - (DataInner::Error(inner), _) => DataInner::Error(inner), - (inner, DataFormat::Error) => inner, - (DataInner::Binary(inner), DataFormat::Binary) => DataInner::Binary(inner), - (DataInner::Text(inner), DataFormat::Text) => DataInner::Text(inner), + let source = self.inner.source; + let filters = self.inner.filters; + let value = match (self.inner.value, format) { + (DataValue::Error(inner), _) => DataValue::Error(inner), + (value, DataFormat::Error) => value, + (DataValue::Binary(inner), DataFormat::Binary) => DataValue::Binary(inner), + (DataValue::Text(inner), DataFormat::Text) => DataValue::Text(inner), #[cfg(feature = "json")] - (DataInner::Json(inner), DataFormat::Json) => DataInner::Json(inner), + (DataValue::Json(inner), DataFormat::Json) => DataValue::Json(inner), #[cfg(feature = "json")] - (DataInner::JsonLines(inner), DataFormat::JsonLines) => DataInner::JsonLines(inner), + (DataValue::JsonLines(inner), DataFormat::JsonLines) => DataValue::JsonLines(inner), #[cfg(feature = "json")] - (DataInner::JsonLines(inner), DataFormat::Json) => DataInner::Json(inner), + (DataValue::JsonLines(inner), DataFormat::Json) => DataValue::Json(inner), #[cfg(feature = "json")] - (DataInner::Json(inner), DataFormat::JsonLines) => DataInner::JsonLines(inner), + (DataValue::Json(inner), DataFormat::JsonLines) => DataValue::JsonLines(inner), #[cfg(feature = "term-svg")] - (DataInner::TermSvg(inner), DataFormat::TermSvg) => DataInner::TermSvg(inner), - (DataInner::Binary(inner), _) => { + (DataValue::TermSvg(inner), DataFormat::TermSvg) => DataValue::TermSvg(inner), + (DataValue::Binary(inner), _) => { if is_binary(&inner) { - DataInner::Binary(inner) + DataValue::Binary(inner) } else { match String::from_utf8(inner) { Ok(str) => { @@ -696,134 +707,137 @@ impl Data { } else { coerced }; - coerced.inner + coerced.inner.value } Err(err) => { let bin = err.into_bytes(); - DataInner::Binary(bin) + DataValue::Binary(bin) } } } } #[cfg(feature = "json")] - (DataInner::Text(inner), DataFormat::Json) => { + (DataValue::Text(inner), DataFormat::Json) => { if let Ok(json) = serde_json::from_str::(&inner) { - DataInner::Json(json) + DataValue::Json(json) } else { - DataInner::Text(inner) + DataValue::Text(inner) } } #[cfg(feature = "json")] - (DataInner::Text(inner), DataFormat::JsonLines) => { + (DataValue::Text(inner), DataFormat::JsonLines) => { if let Ok(jsonlines) = parse_jsonlines(&inner) { - DataInner::JsonLines(serde_json::Value::Array(jsonlines)) + DataValue::JsonLines(serde_json::Value::Array(jsonlines)) } else { - DataInner::Text(inner) + DataValue::Text(inner) } } #[cfg(feature = "term-svg")] - (DataInner::Text(inner), DataFormat::TermSvg) => { - DataInner::TermSvg(anstyle_svg::Term::new().render_svg(&inner)) + (DataValue::Text(inner), DataFormat::TermSvg) => { + DataValue::TermSvg(anstyle_svg::Term::new().render_svg(&inner)) } - (inner, DataFormat::Binary) => { - let remake = Self::with_inner(inner); - DataInner::Binary(remake.to_bytes().expect("error case handled")) + (value, DataFormat::Binary) => { + let remake = Self::with_value(value); + DataValue::Binary(remake.to_bytes().expect("error case handled")) } // This variant is already covered unless structured data is enabled #[cfg(feature = "structured-data")] - (inner, DataFormat::Text) => { - let remake = Self::with_inner(inner); + (value, DataFormat::Text) => { + let remake = Self::with_value(value); if let Some(str) = remake.render() { - DataInner::Text(str) + DataValue::Text(str) } else { - remake.inner + remake.inner.value } } // reachable if more than one structured data format is enabled #[allow(unreachable_patterns)] #[cfg(feature = "json")] - (inner, DataFormat::Json) => inner, + (value, DataFormat::Json) => value, // reachable if more than one structured data format is enabled #[allow(unreachable_patterns)] #[cfg(feature = "json")] - (inner, DataFormat::JsonLines) => inner, + (value, DataFormat::JsonLines) => value, // reachable if more than one structured data format is enabled #[allow(unreachable_patterns)] #[cfg(feature = "term-svg")] - (inner, DataFormat::TermSvg) => inner, + (value, DataFormat::TermSvg) => value, }; Self { - inner, - source, - filters, + inner: Box::new(DataInner { + value, + source, + filters, + }), } } /// Location the data came from pub fn source(&self) -> Option<&DataSource> { - self.source.as_ref() + self.inner.source.as_ref() } /// Outputs the current `DataFormat` of the underlying data pub fn format(&self) -> DataFormat { - match &self.inner { - DataInner::Error(_) => DataFormat::Error, - DataInner::Binary(_) => DataFormat::Binary, - DataInner::Text(_) => DataFormat::Text, + match &self.inner.value { + DataValue::Error(_) => DataFormat::Error, + DataValue::Binary(_) => DataFormat::Binary, + DataValue::Text(_) => DataFormat::Text, #[cfg(feature = "json")] - DataInner::Json(_) => DataFormat::Json, + DataValue::Json(_) => DataFormat::Json, #[cfg(feature = "json")] - DataInner::JsonLines(_) => DataFormat::JsonLines, + DataValue::JsonLines(_) => DataFormat::JsonLines, #[cfg(feature = "term-svg")] - DataInner::TermSvg(_) => DataFormat::TermSvg, + DataValue::TermSvg(_) => DataFormat::TermSvg, } } pub(crate) fn intended_format(&self) -> DataFormat { - match &self.inner { - DataInner::Error(DataError { intended, .. }) => *intended, - DataInner::Binary(_) => DataFormat::Binary, - DataInner::Text(_) => DataFormat::Text, + match &self.inner.value { + DataValue::Error(DataError { intended, .. }) => *intended, + DataValue::Binary(_) => DataFormat::Binary, + DataValue::Text(_) => DataFormat::Text, #[cfg(feature = "json")] - DataInner::Json(_) => DataFormat::Json, + DataValue::Json(_) => DataFormat::Json, #[cfg(feature = "json")] - DataInner::JsonLines(_) => DataFormat::JsonLines, + DataValue::JsonLines(_) => DataFormat::JsonLines, #[cfg(feature = "term-svg")] - DataInner::TermSvg(_) => DataFormat::TermSvg, + DataValue::TermSvg(_) => DataFormat::TermSvg, } } pub(crate) fn against_format(&self) -> DataFormat { - self.filters + self.inner + .filters .get_against() .unwrap_or_else(|| self.intended_format()) } pub(crate) fn relevant(&self) -> Option<&str> { - match &self.inner { - DataInner::Error(_) => None, - DataInner::Binary(_) => None, - DataInner::Text(_) => None, + match &self.inner.value { + DataValue::Error(_) => None, + DataValue::Binary(_) => None, + DataValue::Text(_) => None, #[cfg(feature = "json")] - DataInner::Json(_) => None, + DataValue::Json(_) => None, #[cfg(feature = "json")] - DataInner::JsonLines(_) => None, + DataValue::JsonLines(_) => None, #[cfg(feature = "term-svg")] - DataInner::TermSvg(data) => term_svg_body(data), + DataValue::TermSvg(data) => term_svg_body(data), } } } impl std::fmt::Display for Data { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match &self.inner { - DataInner::Error(data) => data.fmt(f), - DataInner::Binary(data) => String::from_utf8_lossy(data).fmt(f), - DataInner::Text(data) => data.fmt(f), + match &self.inner.value { + DataValue::Error(data) => data.fmt(f), + DataValue::Binary(data) => String::from_utf8_lossy(data).fmt(f), + DataValue::Text(data) => data.fmt(f), #[cfg(feature = "json")] - DataInner::Json(data) => serde_json::to_string_pretty(data).unwrap().fmt(f), + DataValue::Json(data) => serde_json::to_string_pretty(data).unwrap().fmt(f), #[cfg(feature = "json")] - DataInner::JsonLines(data) => { + DataValue::JsonLines(data) => { let array = data.as_array().expect("jsonlines is always an array"); for value in array { writeln!(f, "{}", serde_json::to_string(value).unwrap())?; @@ -831,23 +845,23 @@ impl std::fmt::Display for Data { Ok(()) } #[cfg(feature = "term-svg")] - DataInner::TermSvg(data) => data.fmt(f), + DataValue::TermSvg(data) => data.fmt(f), } } } impl PartialEq for Data { fn eq(&self, other: &Data) -> bool { - match (&self.inner, &other.inner) { - (DataInner::Error(left), DataInner::Error(right)) => left == right, - (DataInner::Binary(left), DataInner::Binary(right)) => left == right, - (DataInner::Text(left), DataInner::Text(right)) => left == right, + match (&self.inner.value, &other.inner.value) { + (DataValue::Error(left), DataValue::Error(right)) => left == right, + (DataValue::Binary(left), DataValue::Binary(right)) => left == right, + (DataValue::Text(left), DataValue::Text(right)) => left == right, #[cfg(feature = "json")] - (DataInner::Json(left), DataInner::Json(right)) => left == right, + (DataValue::Json(left), DataValue::Json(right)) => left == right, #[cfg(feature = "json")] - (DataInner::JsonLines(left), DataInner::JsonLines(right)) => left == right, + (DataValue::JsonLines(left), DataValue::JsonLines(right)) => left == right, #[cfg(feature = "term-svg")] - (DataInner::TermSvg(left), DataInner::TermSvg(right)) => { + (DataValue::TermSvg(left), DataValue::TermSvg(right)) => { // HACK: avoid including `width` and `height` in the comparison let left = term_svg_body(left.as_str()).unwrap_or(left.as_str()); let right = term_svg_body(right.as_str()).unwrap_or(right.as_str()); diff --git a/crates/snapbox/src/data/runtime.rs b/crates/snapbox/src/data/runtime.rs index f4092063..14c36897 100644 --- a/crates/snapbox/src/data/runtime.rs +++ b/crates/snapbox/src/data/runtime.rs @@ -104,8 +104,7 @@ impl Patchwork { if entry.get().1 == patch { return Ok(()); } else { - return Err(std::io::Error::new( - std::io::ErrorKind::Other, + return Err(std::io::Error::other( "cannot update as it was already modified", )); } diff --git a/crates/snapbox/src/data/tests.rs b/crates/snapbox/src/data/tests.rs index 934c315a..ddb762bd 100644 --- a/crates/snapbox/src/data/tests.rs +++ b/crates/snapbox/src/data/tests.rs @@ -6,7 +6,7 @@ use super::*; #[test] #[cfg(feature = "term-svg")] fn term_svg_eq() { - let left = Data::with_inner(DataInner::TermSvg( + let left = Data::with_value(DataValue::TermSvg( " irrelevant relevant @@ -15,7 +15,7 @@ irrelevant irrelevant" .to_owned(), )); - let right = Data::with_inner(DataInner::TermSvg( + let right = Data::with_value(DataValue::TermSvg( " irrelevant relevant @@ -26,7 +26,7 @@ irrelevant" )); assert_eq!(left, right); - let left = Data::with_inner(DataInner::TermSvg( + let left = Data::with_value(DataValue::TermSvg( " irrelevant 1 relevant @@ -35,7 +35,7 @@ irrelevant 1 irrelevant 1" .to_owned(), )); - let right = Data::with_inner(DataInner::TermSvg( + let right = Data::with_value(DataValue::TermSvg( " irrelevant 2 relevant @@ -50,7 +50,7 @@ irrelevant 2" #[test] #[cfg(feature = "term-svg")] fn term_svg_ne() { - let left = Data::with_inner(DataInner::TermSvg( + let left = Data::with_value(DataValue::TermSvg( " irrelevant 1 relevant 1 @@ -59,7 +59,7 @@ irrelevant 1 irrelevant 1" .to_owned(), )); - let right = Data::with_inner(DataInner::TermSvg( + let right = Data::with_value(DataValue::TermSvg( " irrelevant 2 relevant 2 diff --git a/crates/snapbox/src/dir/mod.rs b/crates/snapbox/src/dir/mod.rs index 18ea24e7..157afd6f 100644 --- a/crates/snapbox/src/dir/mod.rs +++ b/crates/snapbox/src/dir/mod.rs @@ -11,11 +11,11 @@ pub use diff::FileType; pub use diff::PathDiff; pub use fixture::DirFixture; #[cfg(feature = "dir")] +pub use ops::Walk; +#[cfg(feature = "dir")] pub use ops::copy_template; pub use ops::resolve_dir; pub use ops::strip_trailing_slash; -#[cfg(feature = "dir")] -pub use ops::Walk; pub use root::DirRoot; #[cfg(feature = "dir")] diff --git a/crates/snapbox/src/filter/mod.rs b/crates/snapbox/src/filter/mod.rs index 450c10a9..4a5161d8 100644 --- a/crates/snapbox/src/filter/mod.rs +++ b/crates/snapbox/src/filter/mod.rs @@ -13,8 +13,8 @@ mod test_redactions; #[cfg(test)] mod test_unordered_redactions; -use crate::data::DataInner; use crate::Data; +use crate::data::DataValue; pub use pattern::NormalizeToExpected; pub use redactions::RedactedValue; @@ -27,37 +27,39 @@ pub trait Filter { pub struct FilterNewlines; impl Filter for FilterNewlines { fn filter(&self, data: Data) -> Data { - let source = data.source; - let filters = data.filters; - let inner = match data.inner { - DataInner::Error(err) => DataInner::Error(err), - DataInner::Binary(bin) => DataInner::Binary(bin), - DataInner::Text(text) => { + let source = data.inner.source; + let filters = data.inner.filters; + let inner = match data.inner.value { + DataValue::Error(err) => DataValue::Error(err), + DataValue::Binary(bin) => DataValue::Binary(bin), + DataValue::Text(text) => { let lines = normalize_lines(&text); - DataInner::Text(lines) + DataValue::Text(lines) } #[cfg(feature = "json")] - DataInner::Json(value) => { + DataValue::Json(value) => { let mut value = value; normalize_json_string(&mut value, &normalize_lines); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - DataInner::JsonLines(value) => { + DataValue::JsonLines(value) => { let mut value = value; normalize_json_string(&mut value, &normalize_lines); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - DataInner::TermSvg(text) => { + DataValue::TermSvg(text) => { let lines = normalize_lines(&text); - DataInner::TermSvg(lines) + DataValue::TermSvg(lines) } }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } } @@ -74,37 +76,39 @@ fn normalize_lines_chars(data: impl Iterator) -> impl Iterator Data { - let source = data.source; - let filters = data.filters; - let inner = match data.inner { - DataInner::Error(err) => DataInner::Error(err), - DataInner::Binary(bin) => DataInner::Binary(bin), - DataInner::Text(text) => { + let source = data.inner.source; + let filters = data.inner.filters; + let inner = match data.inner.value { + DataValue::Error(err) => DataValue::Error(err), + DataValue::Binary(bin) => DataValue::Binary(bin), + DataValue::Text(text) => { let lines = normalize_paths(&text); - DataInner::Text(lines) + DataValue::Text(lines) } #[cfg(feature = "json")] - DataInner::Json(value) => { + DataValue::Json(value) => { let mut value = value; normalize_json_string(&mut value, &normalize_paths); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - DataInner::JsonLines(value) => { + DataValue::JsonLines(value) => { let mut value = value; normalize_json_string(&mut value, &normalize_paths); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - DataInner::TermSvg(text) => { + DataValue::TermSvg(text) => { let lines = normalize_paths(&text); - DataInner::TermSvg(lines) + DataValue::TermSvg(lines) } }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } } @@ -128,37 +132,39 @@ struct NormalizeRedactions<'r> { } impl Filter for NormalizeRedactions<'_> { fn filter(&self, data: Data) -> Data { - let source = data.source; - let filters = data.filters; - let inner = match data.inner { - DataInner::Error(err) => DataInner::Error(err), - DataInner::Binary(bin) => DataInner::Binary(bin), - DataInner::Text(text) => { + let source = data.inner.source; + let filters = data.inner.filters; + let inner = match data.inner.value { + DataValue::Error(err) => DataValue::Error(err), + DataValue::Binary(bin) => DataValue::Binary(bin), + DataValue::Text(text) => { let lines = self.redactions.redact(&text); - DataInner::Text(lines) + DataValue::Text(lines) } #[cfg(feature = "json")] - DataInner::Json(value) => { + DataValue::Json(value) => { let mut value = value; normalize_json_string(&mut value, &|s| self.redactions.redact(s)); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - DataInner::JsonLines(value) => { + DataValue::JsonLines(value) => { let mut value = value; normalize_json_string(&mut value, &|s| self.redactions.redact(s)); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - DataInner::TermSvg(text) => { + DataValue::TermSvg(text) => { let lines = self.redactions.redact(&text); - DataInner::TermSvg(lines) + DataValue::TermSvg(lines) } }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } } diff --git a/crates/snapbox/src/filter/pattern.rs b/crates/snapbox/src/filter/pattern.rs index a6200914..066283ce 100644 --- a/crates/snapbox/src/filter/pattern.rs +++ b/crates/snapbox/src/filter/pattern.rs @@ -1,6 +1,6 @@ use super::{Filter, NormalizeRedactions, Redactions}; -use crate::data::DataInner; use crate::Data; +use crate::data::DataValue; /// Adjust `actual` based on `expected` pub struct NormalizeToExpected<'a> { @@ -78,41 +78,41 @@ impl Default for NormalizeToExpected<'_> { } fn normalize_data_to_unordered(actual: Data, expected: &Data) -> Data { - let source = actual.source; - let filters = actual.filters; - let inner = match (actual.inner, &expected.inner) { - (DataInner::Error(err), _) => DataInner::Error(err), - (DataInner::Binary(bin), _) => DataInner::Binary(bin), - (DataInner::Text(text), _) => { + let source = actual.inner.source; + let filters = actual.inner.filters; + let inner = match (actual.inner.value, &expected.inner.value) { + (DataValue::Error(err), _) => DataValue::Error(err), + (DataValue::Binary(bin), _) => DataValue::Binary(bin), + (DataValue::Text(text), _) => { if let Some(pattern) = expected.render() { let lines = normalize_str_to_unordered(&text, &pattern); - DataInner::Text(lines) + DataValue::Text(lines) } else { - DataInner::Text(text) + DataValue::Text(text) } } #[cfg(feature = "json")] - (DataInner::Json(value), DataInner::Json(exp)) => { + (DataValue::Json(value), DataValue::Json(exp)) => { let mut value = value; normalize_value_to_unordered(&mut value, exp); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - (DataInner::JsonLines(value), DataInner::JsonLines(exp)) => { + (DataValue::JsonLines(value), DataValue::JsonLines(exp)) => { let mut value = value; normalize_value_to_unordered(&mut value, exp); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - (DataInner::TermSvg(text), DataInner::TermSvg(exp)) => { + (DataValue::TermSvg(text), DataValue::TermSvg(exp)) => { if let (Some((header, body, footer)), Some((_, exp, _))) = ( crate::data::split_term_svg(&text), crate::data::split_term_svg(exp), ) { let lines = normalize_str_to_unordered(body, exp); - DataInner::TermSvg(format!("{header}{lines}{footer}")) + DataValue::TermSvg(format!("{header}{lines}{footer}")) } else { - DataInner::TermSvg(text) + DataValue::TermSvg(text) } } // reachable if more than one structured data format is enabled @@ -120,9 +120,11 @@ fn normalize_data_to_unordered(actual: Data, expected: &Data) -> Data { (inner, _) => inner, }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } @@ -208,41 +210,41 @@ fn normalize_data_to_unordered_redactions( expected: &Data, substitutions: &Redactions, ) -> Data { - let source = actual.source; - let filters = actual.filters; - let inner = match (actual.inner, &expected.inner) { - (DataInner::Error(err), _) => DataInner::Error(err), - (DataInner::Binary(bin), _) => DataInner::Binary(bin), - (DataInner::Text(text), _) => { + let source = actual.inner.source; + let filters = actual.inner.filters; + let inner = match (actual.inner.value, &expected.inner.value) { + (DataValue::Error(err), _) => DataValue::Error(err), + (DataValue::Binary(bin), _) => DataValue::Binary(bin), + (DataValue::Text(text), _) => { if let Some(pattern) = expected.render() { let lines = normalize_str_to_unordered_redactions(&text, &pattern, substitutions); - DataInner::Text(lines) + DataValue::Text(lines) } else { - DataInner::Text(text) + DataValue::Text(text) } } #[cfg(feature = "json")] - (DataInner::Json(value), DataInner::Json(exp)) => { + (DataValue::Json(value), DataValue::Json(exp)) => { let mut value = value; normalize_value_to_unordered_redactions(&mut value, exp, substitutions); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - (DataInner::JsonLines(value), DataInner::JsonLines(exp)) => { + (DataValue::JsonLines(value), DataValue::JsonLines(exp)) => { let mut value = value; normalize_value_to_unordered_redactions(&mut value, exp, substitutions); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - (DataInner::TermSvg(text), DataInner::TermSvg(exp)) => { + (DataValue::TermSvg(text), DataValue::TermSvg(exp)) => { if let (Some((header, body, footer)), Some((_, exp, _))) = ( crate::data::split_term_svg(&text), crate::data::split_term_svg(exp), ) { let lines = normalize_str_to_unordered_redactions(body, exp, substitutions); - DataInner::TermSvg(format!("{header}{lines}{footer}")) + DataValue::TermSvg(format!("{header}{lines}{footer}")) } else { - DataInner::TermSvg(text) + DataValue::TermSvg(text) } } // reachable if more than one structured data format is enabled @@ -250,9 +252,11 @@ fn normalize_data_to_unordered_redactions( (inner, _) => inner, }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } @@ -389,41 +393,41 @@ fn normalize_str_to_unordered_redactions( } fn normalize_data_to_redactions(actual: Data, expected: &Data, substitutions: &Redactions) -> Data { - let source = actual.source; - let filters = actual.filters; - let inner = match (actual.inner, &expected.inner) { - (DataInner::Error(err), _) => DataInner::Error(err), - (DataInner::Binary(bin), _) => DataInner::Binary(bin), - (DataInner::Text(text), _) => { + let source = actual.inner.source; + let filters = actual.inner.filters; + let inner = match (actual.inner.value, &expected.inner.value) { + (DataValue::Error(err), _) => DataValue::Error(err), + (DataValue::Binary(bin), _) => DataValue::Binary(bin), + (DataValue::Text(text), _) => { if let Some(pattern) = expected.render() { let lines = normalize_str_to_redactions(&text, &pattern, substitutions); - DataInner::Text(lines) + DataValue::Text(lines) } else { - DataInner::Text(text) + DataValue::Text(text) } } #[cfg(feature = "json")] - (DataInner::Json(value), DataInner::Json(exp)) => { + (DataValue::Json(value), DataValue::Json(exp)) => { let mut value = value; normalize_value_to_redactions(&mut value, exp, substitutions); - DataInner::Json(value) + DataValue::Json(value) } #[cfg(feature = "json")] - (DataInner::JsonLines(value), DataInner::JsonLines(exp)) => { + (DataValue::JsonLines(value), DataValue::JsonLines(exp)) => { let mut value = value; normalize_value_to_redactions(&mut value, exp, substitutions); - DataInner::JsonLines(value) + DataValue::JsonLines(value) } #[cfg(feature = "term-svg")] - (DataInner::TermSvg(text), DataInner::TermSvg(exp)) => { + (DataValue::TermSvg(text), DataValue::TermSvg(exp)) => { if let (Some((header, body, footer)), Some((_, exp, _))) = ( crate::data::split_term_svg(&text), crate::data::split_term_svg(exp), ) { let lines = normalize_str_to_redactions(body, exp, substitutions); - DataInner::TermSvg(format!("{header}{lines}{footer}")) + DataValue::TermSvg(format!("{header}{lines}{footer}")) } else { - DataInner::TermSvg(text) + DataValue::TermSvg(text) } } // reachable if more than one structured data format is enabled @@ -431,9 +435,11 @@ fn normalize_data_to_redactions(actual: Data, expected: &Data, substitutions: &R (inner, _) => inner, }; Data { - inner, - source, - filters, + inner: Box::new(crate::data::DataInner { + value: inner, + source, + filters, + }), } } diff --git a/crates/snapbox/src/filter/test_redactions.rs b/crates/snapbox/src/filter/test_redactions.rs index c26d9ab9..7a2dcc5e 100644 --- a/crates/snapbox/src/filter/test_redactions.rs +++ b/crates/snapbox/src/filter/test_redactions.rs @@ -250,7 +250,8 @@ fn json_normalize_glob_for_string() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -271,7 +272,8 @@ fn json_normalize_glob_for_array() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -290,7 +292,8 @@ fn json_normalize_glob_for_obj() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -327,7 +330,8 @@ fn json_normalize_glob_array_start() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -365,7 +369,8 @@ fn json_normalize_glob_for_array_start_end() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -411,7 +416,8 @@ fn json_normalize_glob_for_array_middle_end() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -453,7 +459,7 @@ fn json_normalize_glob_for_array_mismatch() { let actual_normalized = NormalizeToExpected::new() .redact() .normalize(Data::json(actual.clone()), &expected); - if let DataInner::Json(act) = actual_normalized.inner { + if let DataValue::Json(act) = actual_normalized.inner.value { assert_eq!(act, actual); } } @@ -471,7 +477,8 @@ fn json_normalize_bad_order() { let actual = NormalizeToExpected::new() .redact() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_ne!(exp, act); } } diff --git a/crates/snapbox/src/filter/test_unordered_redactions.rs b/crates/snapbox/src/filter/test_unordered_redactions.rs index 82b8a451..2b3a2d5b 100644 --- a/crates/snapbox/src/filter/test_unordered_redactions.rs +++ b/crates/snapbox/src/filter/test_unordered_redactions.rs @@ -394,7 +394,8 @@ fn json_normalize_glob_for_string() { .redact() .unordered() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -416,7 +417,8 @@ fn json_normalize_glob_for_array() { .redact() .unordered() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -436,7 +438,8 @@ fn json_normalize_glob_for_obj() { .redact() .unordered() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -474,7 +477,8 @@ fn json_normalize_glob_array_start() { .redact() .unordered() .normalize(Data::json(actual), &expected); - if let (DataInner::Json(exp), DataInner::Json(act)) = (expected.inner, actual.inner) { + if let (DataValue::Json(exp), DataValue::Json(act)) = (expected.inner.value, actual.inner.value) + { assert_eq!(exp, act); } } @@ -523,7 +527,7 @@ fn json_normalize_glob_for_array_mismatch() { .redact() .unordered() .normalize(Data::json(actual.clone()), &expected); - if let DataInner::Json(act) = actual_normalized.inner { + if let DataValue::Json(act) = actual_normalized.inner.value { assert_eq!(act, expected_actual); } } diff --git a/crates/snapbox/src/report/diff.rs b/crates/snapbox/src/report/diff.rs index 7a53aca4..d99e59e8 100644 --- a/crates/snapbox/src/report/diff.rs +++ b/crates/snapbox/src/report/diff.rs @@ -486,8 +486,8 @@ Hello World let mut actual_diff = String::new(); write_diff( &mut actual_diff, - &crate::Data::with_inner(crate::data::DataInner::TermSvg(expected.to_owned())), - &crate::Data::with_inner(crate::data::DataInner::TermSvg(actual.to_owned())), + &crate::Data::with_value(crate::data::DataValue::TermSvg(expected.to_owned())), + &crate::Data::with_value(crate::data::DataValue::TermSvg(actual.to_owned())), Some(&expected_name), Some(&actual_name), palette, diff --git a/crates/trycmd/Cargo.toml b/crates/trycmd/Cargo.toml index 8470562a..0b3b9279 100644 --- a/crates/trycmd/Cargo.toml +++ b/crates/trycmd/Cargo.toml @@ -42,21 +42,21 @@ name = "trycmd-schema" required-features = ["schema"] [dependencies] -automod = "1.0.15" +automod = "1.0.16" snapbox = { path = "../snapbox", version = "1.1.0", default-features = false, features = ["cmd"] } anstream = { version = "1.0.0", optional = true } glob = "0.3.3" -rayon = "1.10.0" +rayon = "1.11.0" serde = { version = "1.0", features = ["derive"] } shlex = "1.3.0" humantime = "2" humantime-serde = "1" -toml_edit = { version = "0.23.5", features = ["serde"] } -escargot = { version = "0.5.14", optional = true } +toml_edit = { version = "0.25.7", features = ["serde"] } +escargot = { version = "0.5.15", optional = true } -schemars = { version = "0.8.22", features = ["preserve_order"], optional = true } +schemars = { version = "1.2.1", features = ["preserve_order"], optional = true } serde_json = { version = "1.0", optional = true } [lints] diff --git a/crates/trycmd/schema.json b/crates/trycmd/schema.json index c88afc34..8e72a025 100644 --- a/crates/trycmd/schema.json +++ b/crates/trycmd/schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "OneShot", "description": "Top-level data in `cmd.toml` files", "type": "object", @@ -7,7 +7,7 @@ "bin": { "anyOf": [ { - "$ref": "#/definitions/Bin" + "$ref": "#/$defs/Bin" }, { "type": "null" @@ -15,54 +15,46 @@ ] }, "args": { - "default": [], - "allOf": [ - { - "$ref": "#/definitions/Args" - } - ] + "$ref": "#/$defs/Args", + "default": [] }, "env": { + "$ref": "#/$defs/Env", "default": { - "add": {}, "inherit": null, + "add": {}, "remove": [] - }, - "allOf": [ - { - "$ref": "#/definitions/Env" - } - ] + } }, "stdin": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stdout": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stderr": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stderr-to-stdout": { - "default": false, - "type": "boolean" + "type": "boolean", + "default": false }, "status": { "anyOf": [ { - "$ref": "#/definitions/CommandStatus" + "$ref": "#/$defs/CommandStatus" }, { "type": "null" @@ -70,34 +62,30 @@ ] }, "binary": { - "default": false, - "type": "boolean" + "type": "boolean", + "default": false }, "timeout": { - "default": null, "anyOf": [ { - "$ref": "#/definitions/Duration" + "$ref": "#/$defs/Duration" }, { "type": "null" } - ] + ], + "default": null }, "fs": { + "$ref": "#/$defs/Filesystem", "default": { - "base": null, "cwd": null, + "base": null, "sandbox": null - }, - "allOf": [ - { - "$ref": "#/definitions/Filesystem" - } - ] + } } }, - "definitions": { + "$defs": { "Bin": { "description": "Target under test", "oneOf": [ @@ -109,26 +97,26 @@ }, { "type": "object", - "required": [ - "path" - ], "properties": { "path": { "type": "string" } }, + "required": [ + "path" + ], "additionalProperties": false }, { "type": "object", - "required": [ - "name" - ], "properties": { "name": { "type": "string" } }, + "required": [ + "name" + ], "additionalProperties": false } ] @@ -136,7 +124,7 @@ "Args": { "anyOf": [ { - "$ref": "#/definitions/JoinedArgs" + "$ref": "#/$defs/JoinedArgs" }, { "type": "array", @@ -148,9 +136,6 @@ }, "JoinedArgs": { "type": "object", - "required": [ - "inner" - ], "properties": { "inner": { "type": "array", @@ -158,32 +143,35 @@ "type": "string" } } - } + }, + "required": [ + "inner" + ] }, "Env": { "description": "Describe command's environment", "type": "object", "properties": { "inherit": { - "default": null, "type": [ "boolean", "null" - ] + ], + "default": null }, "add": { - "default": {}, "type": "object", "additionalProperties": { "type": "string" - } + }, + "default": {} }, "remove": { - "default": [], "type": "array", "items": { "type": "string" - } + }, + "default": [] } } }, @@ -201,37 +189,37 @@ }, { "type": "object", - "required": [ - "code" - ], "properties": { "code": { "type": "integer", "format": "int32" } }, + "required": [ + "code" + ], "additionalProperties": false } ] }, "Duration": { "type": "object", - "required": [ - "nanos", - "secs" - ], "properties": { "secs": { "type": "integer", "format": "uint64", - "minimum": 0.0 + "minimum": 0 }, "nanos": { "type": "integer", "format": "uint32", - "minimum": 0.0 + "minimum": 0 } - } + }, + "required": [ + "secs", + "nanos" + ] }, "Filesystem": { "description": "Describe the command's filesystem context", diff --git a/crates/trycmd/src/runner.rs b/crates/trycmd/src/runner.rs index 6488ca1f..eaa4cc57 100644 --- a/crates/trycmd/src/runner.rs +++ b/crates/trycmd/src/runner.rs @@ -12,10 +12,10 @@ use std::eprintln; use std::io::stderr; use rayon::prelude::*; +use snapbox::IntoData; use snapbox::data::DataFormat; use snapbox::dir::FileType; use snapbox::filter::{Filter as _, FilterNewlines, FilterPaths, NormalizeToExpected}; -use snapbox::IntoData; #[derive(Debug)] pub(crate) struct Runner { @@ -567,11 +567,7 @@ impl Case { } } - if ok { - Ok(fs) - } else { - Err(fs) - } + if ok { Ok(fs) } else { Err(fs) } } } diff --git a/crates/trycmd/src/schema.rs b/crates/trycmd/src/schema.rs index 944c439a..e1b92056 100644 --- a/crates/trycmd/src/schema.rs +++ b/crates/trycmd/src/schema.rs @@ -380,7 +380,7 @@ fn overwrite_toml_status( if let Some(code) = status.code() { if status.success() { match doc.get("status") { - Some(toml_edit::Item::Value(toml_edit::Value::String(ref expected))) + Some(toml_edit::Item::Value(toml_edit::Value::String(expected))) if expected.value() == "success" => {} Some( toml_edit::Item::Value(toml_edit::Value::InlineTable(_)) @@ -388,7 +388,7 @@ fn overwrite_toml_status( ) => { if !matches!( doc["status"].get("code"), - Some(toml_edit::Item::Value(toml_edit::Value::Integer(ref expected))) + Some(toml_edit::Item::Value(toml_edit::Value::Integer(expected))) if expected.value() == &0) { // Remove `status` to use the default value (success) @@ -403,7 +403,7 @@ fn overwrite_toml_status( } else { let code = code as i64; match doc.get("status") { - Some(toml_edit::Item::Value(toml_edit::Value::String(ref expected))) => { + Some(toml_edit::Item::Value(toml_edit::Value::String(expected))) => { if expected.value() != "failed" { doc["status"] = toml_edit::value("failed"); } @@ -414,7 +414,7 @@ fn overwrite_toml_status( ) => { if !matches!( doc["status"].get("code"), - Some(toml_edit::Item::Value(toml_edit::Value::Integer(ref expected))) + Some(toml_edit::Item::Value(toml_edit::Value::Integer(expected))) if expected.value() == &code) { doc["status"]["code"] = toml_edit::value(code); @@ -430,7 +430,7 @@ fn overwrite_toml_status( } } else if !matches!( doc.get("status"), - Some(toml_edit::Item::Value(toml_edit::Value::String(ref expected))) + Some(toml_edit::Item::Value(toml_edit::Value::String(expected))) if expected.value() == "interrupted") { doc["status"] = toml_edit::value("interrupted"); diff --git a/crates/tryfn/Cargo.toml b/crates/tryfn/Cargo.toml index 1850109c..5d4a55a1 100644 --- a/crates/tryfn/Cargo.toml +++ b/crates/tryfn/Cargo.toml @@ -31,5 +31,5 @@ color-auto = ["snapbox/color-auto"] [dependencies] snapbox = { path = "../snapbox", version = "1.1.0", default-features = false } -libtest-mimic = "0.7.3" -ignore = "0.4.20" +libtest-mimic = "0.8.2" +ignore = "0.4.25" diff --git a/crates/tryfn/src/lib.rs b/crates/tryfn/src/lib.rs index 8118015e..74f01051 100644 --- a/crates/tryfn/src/lib.rs +++ b/crates/tryfn/src/lib.rs @@ -45,8 +45,8 @@ use libtest_mimic::Trial; -pub use snapbox::data::DataFormat; pub use snapbox::Data; +pub use snapbox::data::DataFormat; /// [`Harness`] for discovering test inputs and asserting against snapshot files pub struct Harness {