diff --git a/Cargo.lock b/Cargo.lock index 33e35fc..041775a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,6 +79,22 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bca1619ff57dd7a56b58a8e25ef4199f123e78e503fe1653410350a1b98ae65" +[[package]] +name = "dissimilar" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4b29f4b9bb94bf267d57269fd0706d343a160937108e9619fe380645428abb" + +[[package]] +name = "expect-test" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2300477aab3a378f2ca00a4fbd4dc713654ab7ed790e4017493cb33656280633" +dependencies = [ + "dissimilar", + "once_cell", +] + [[package]] name = "heck" version = "0.3.3" @@ -121,6 +137,7 @@ version = "0.5.0" dependencies = [ "clap", "colorful", + "expect-test", "num_cpus", "pathdiff", "regex", @@ -157,6 +174,12 @@ dependencies = [ "libc", ] +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" + [[package]] name = "pathdiff" version = "0.2.0" diff --git a/default.nix b/default.nix index 1c8c4da..a09535c 100644 --- a/default.nix +++ b/default.nix @@ -10,7 +10,7 @@ pkgs.rustPlatform.buildRustPackage { pname = "nix-doc"; version = "0.5.0"; - cargoSha256 = "0jkn1rqiwjb8yr66h7mija5gkswvb379cc1wp6gq5dbb29ggxbj2"; + cargoSha256 = "0xmw3fyic0fcg7a6z8dr3lv367bxqdhdrlrl2hhlz59xg5kq8b3f"; src = gitignoreSource ./.; diff --git a/nix-doc/src/tags.rs b/nix-doc/src/tags.rs index 5417fc6..620dd72 100644 --- a/nix-doc/src/tags.rs +++ b/nix-doc/src/tags.rs @@ -359,7 +359,8 @@ mod tests { use super::*; use expect_test::{expect, Expect}; - fn check(dir: PathBuf, expected: Expect) { + fn check(dir: &str, expected: Expect) { + let dir = PathBuf::from(dir); let curdir = current_dir().unwrap(); println!("datadir: {}", &dir.display()); @@ -378,7 +379,7 @@ mod tests { #[test] fn smoke() { check( - PathBuf::from("testdata"), + "testdata", expect![[r#" !_TAG_FILE_FORMAT 2 /extended format/ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/