From 803094f67a257204e812a148c81000b31e42140b Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 14 Feb 2024 20:28:51 -0600 Subject: [PATCH] chore: Update snapbox --- Cargo.lock | 31 ++++++++++++++++++-------- crates/codespell-dict/Cargo.toml | 2 +- crates/codespell-dict/tests/codegen.rs | 4 ++-- crates/misspell-dict/Cargo.toml | 2 +- crates/misspell-dict/tests/codegen.rs | 2 +- crates/typos-cli/Cargo.toml | 4 ++-- crates/typos-dict/Cargo.toml | 2 +- crates/typos-dict/tests/codegen.rs | 2 +- crates/typos-dict/tests/verify.rs | 5 ++--- crates/typos-vars/Cargo.toml | 2 +- crates/typos-vars/tests/codegen.rs | 2 +- crates/varcon/Cargo.toml | 2 +- crates/varcon/tests/codegen.rs | 2 +- crates/wikipedia-dict/Cargo.toml | 2 +- crates/wikipedia-dict/tests/codegen.rs | 2 +- 15 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53b064f..a900bfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1136,9 +1136,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "snapbox" -version = "0.4.16" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73145a30df4935f50a7b13c1882bce7d194d7071ad0bcc36e7cacbf9ef16e3ec" +checksum = "8269b717f21b142c0377f1e617e80999e3ef6b1c010959b44fd93320722d2cba" dependencies = [ "anstream", "anstyle", @@ -1158,9 +1158,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ccde059aad940984ff696fe8c280900f7ea71a6fb45fce65071a3f2c40b667" +checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" dependencies = [ "anstream", ] @@ -1267,7 +1267,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.21.1", ] [[package]] @@ -1293,10 +1293,23 @@ dependencies = [ ] [[package]] -name = "trycmd" -version = "0.14.20" +name = "toml_edit" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ad3a033f38ca4d9eedf36ba792622027119c61b62b57970c5bed42cfd0c40d" +checksum = "99e68c159e8f5ba8a28c4eb7b0c0c190d77bb479047ca713270048145a9ad28a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.0", +] + +[[package]] +name = "trycmd" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464edb3603a81a50b4c8f47b11dfade69ef48ffdc0af2f8b194ad87cbda75317" dependencies = [ "glob", "humantime", @@ -1305,7 +1318,7 @@ dependencies = [ "serde", "shlex", "snapbox", - "toml_edit", + "toml_edit 0.22.5", ] [[package]] diff --git a/crates/codespell-dict/Cargo.toml b/crates/codespell-dict/Cargo.toml index 7b58374..a9447b6 100644 --- a/crates/codespell-dict/Cargo.toml +++ b/crates/codespell-dict/Cargo.toml @@ -24,5 +24,5 @@ unicase = "2.7" itertools = "0.12" codegenrs = "3.0" dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } typos = { path = "../typos" } diff --git a/crates/codespell-dict/tests/codegen.rs b/crates/codespell-dict/tests/codegen.rs index 734cf6c..a25b443 100644 --- a/crates/codespell-dict/tests/codegen.rs +++ b/crates/codespell-dict/tests/codegen.rs @@ -7,7 +7,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/dict_codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content); } #[test] @@ -31,7 +31,7 @@ fn compat() { writeln!(content).unwrap(); } - snapbox::assert_eq_path("./assets/compatible.csv", &content); + snapbox::assert_eq(snapbox::file!["../assets/compatible.csv"], &content); } fn is_word(word: &str) -> bool { diff --git a/crates/misspell-dict/Cargo.toml b/crates/misspell-dict/Cargo.toml index 61eff78..fbffa02 100644 --- a/crates/misspell-dict/Cargo.toml +++ b/crates/misspell-dict/Cargo.toml @@ -24,4 +24,4 @@ itertools = "0.12" codegenrs = "3.0" regex = "1" dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } diff --git a/crates/misspell-dict/tests/codegen.rs b/crates/misspell-dict/tests/codegen.rs index f8f2bea..734a7ab 100644 --- a/crates/misspell-dict/tests/codegen.rs +++ b/crates/misspell-dict/tests/codegen.rs @@ -9,7 +9,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/dict_codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content); } fn generate(file: &mut W) { diff --git a/crates/typos-cli/Cargo.toml b/crates/typos-cli/Cargo.toml index 2865213..bc357d2 100644 --- a/crates/typos-cli/Cargo.toml +++ b/crates/typos-cli/Cargo.toml @@ -80,8 +80,8 @@ encoding_rs = "0.8.33" [dev-dependencies] assert_fs = "1.1" divan = "0.1.11" -snapbox = "0.4.16" -trycmd = "0.14.20" +snapbox = "0.5.0" +trycmd = "0.15.0" [[bench]] name = "check_file" diff --git a/crates/typos-dict/Cargo.toml b/crates/typos-dict/Cargo.toml index 9c1c240..ef1960f 100644 --- a/crates/typos-dict/Cargo.toml +++ b/crates/typos-dict/Cargo.toml @@ -23,5 +23,5 @@ unicase = "2.7" codegenrs = "3.0" dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] } varcon = { version = "^0.7", path = "../varcon" } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } indexmap = "2.2.2" diff --git a/crates/typos-dict/tests/codegen.rs b/crates/typos-dict/tests/codegen.rs index fb6a317..e6adef3 100644 --- a/crates/typos-dict/tests/codegen.rs +++ b/crates/typos-dict/tests/codegen.rs @@ -6,7 +6,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/word_codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/word_codegen.rs"], content); } fn generate(file: &mut W, prefix: &str, dict: &[u8]) { diff --git a/crates/typos-dict/tests/verify.rs b/crates/typos-dict/tests/verify.rs index 0755716..ccbaa97 100644 --- a/crates/typos-dict/tests/verify.rs +++ b/crates/typos-dict/tests/verify.rs @@ -8,8 +8,7 @@ type Dict = BTreeMap, IndexSet>; #[test] fn verify() { - let asset_path = "assets/words.csv"; - let typos_dict = parse_dict(asset_path); + let typos_dict = parse_dict("assets/words.csv"); let new_dict = process(typos_dict); let mut content = vec![]; @@ -26,7 +25,7 @@ fn verify() { drop(wtr); let content = String::from_utf8(content).unwrap(); - snapbox::assert_eq_path(asset_path, content); + snapbox::assert_eq(snapbox::file!["../assets/words.csv"], content); } fn parse_dict(path: &str) -> Vec<(String, Vec)> { diff --git a/crates/typos-vars/Cargo.toml b/crates/typos-vars/Cargo.toml index a7104cc..6035bd2 100644 --- a/crates/typos-vars/Cargo.toml +++ b/crates/typos-vars/Cargo.toml @@ -24,4 +24,4 @@ unicase = "2.7" codegenrs = "3.0" itertools = "0.12" dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } diff --git a/crates/typos-vars/tests/codegen.rs b/crates/typos-vars/tests/codegen.rs index 4f66906..d388199 100644 --- a/crates/typos-vars/tests/codegen.rs +++ b/crates/typos-vars/tests/codegen.rs @@ -9,7 +9,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/vars_codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/vars_codegen.rs"], content); } static CATEGORIES: [varcon::Category; 4] = [ diff --git a/crates/varcon/Cargo.toml b/crates/varcon/Cargo.toml index 487ed0b..e8f3f41 100644 --- a/crates/varcon/Cargo.toml +++ b/crates/varcon/Cargo.toml @@ -22,4 +22,4 @@ varcon-core = { version = "^4.0", path = "../varcon-core" } [dev-dependencies] codegenrs = "3.0" varcon-core = { version = "^4.0", path = "../varcon-core", features = ["parser"] } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } diff --git a/crates/varcon/tests/codegen.rs b/crates/varcon/tests/codegen.rs index ef5590a..43f8308 100644 --- a/crates/varcon/tests/codegen.rs +++ b/crates/varcon/tests/codegen.rs @@ -7,7 +7,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/codegen.rs"], content); } fn generate(file: &mut W) { diff --git a/crates/wikipedia-dict/Cargo.toml b/crates/wikipedia-dict/Cargo.toml index 897f6b0..637ad21 100644 --- a/crates/wikipedia-dict/Cargo.toml +++ b/crates/wikipedia-dict/Cargo.toml @@ -24,4 +24,4 @@ unicase = "2.7" itertools = "0.12" codegenrs = "3.0" dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] } -snapbox = { version = "0.4.16", features = ["path"] } +snapbox = { version = "0.5.0", features = ["path"] } diff --git a/crates/wikipedia-dict/tests/codegen.rs b/crates/wikipedia-dict/tests/codegen.rs index f1a7fc6..bee7462 100644 --- a/crates/wikipedia-dict/tests/codegen.rs +++ b/crates/wikipedia-dict/tests/codegen.rs @@ -7,7 +7,7 @@ fn codegen() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/dict_codegen.rs", content); + snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content); } fn generate(file: &mut W) {