diff --git a/CHANGELOG.md b/CHANGELOG.md index 82f4e02..118e10b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ## main branch * Added missing crate documentation. +* Updated dependencies. ### Bug fixes diff --git a/Cargo.lock b/Cargo.lock index 8839369..2b9f4ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,6 +60,22 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "anyhow-std" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "371af0f4200b11811edaa039fc8d12b7dcc41905129af16511f6518c1f24bc0d" +dependencies = [ + "anyhow", + "derive_more", +] + [[package]] name = "assert_cmd" version = "2.0.11" @@ -156,6 +172,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "ctor" version = "0.1.26" @@ -166,6 +188,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + [[package]] name = "diff" version = "0.1.13" @@ -232,6 +267,21 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "function_name" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1ab577a896d09940b5fe12ec5ae71f9d8211fff62c919c03a3750a9901e98a7" +dependencies = [ + "function_name-proc-macro", +] + +[[package]] +name = "function_name-proc-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673464e1e314dd67a0fd9544abc99e8eb28d0c7e3b69b033bcff9b2d00b87333" + [[package]] name = "git-status-vars" version = "1.0.0" @@ -492,6 +542,15 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.37.19" @@ -506,6 +565,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + [[package]] name = "serde" version = "1.0.163" @@ -558,23 +623,26 @@ dependencies = [ [[package]] name = "target-test-dir" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806cbbcf0c01237317c96d7e5a651938541c2c207bc962bd4c7bb93cd76c6237" +checksum = "7dfe0c3c458e3b5ed6fa2f1c48bffcf2081bb481696cd4464fb31305dd19d1b6" dependencies = [ + "anyhow", + "anyhow-std", + "function_name", "once_cell", "target-test-dir-macro", ] [[package]] name = "target-test-dir-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e0ab6586c087cca267be87457a8abfbb625cbc07175daae978c9e1168bfebad" +checksum = "3934024009147bb121b6e0c6a653208f9dc889cf9bdb4b1eceee3735da2612ed" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.16", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3b92359..d93d343 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,4 +24,4 @@ bstr = { version = "1.1.0", default-features = false, features = ["std"] } duct = "0.13.6" pretty_assertions = "1.3.0" regex = "1.7.0" -target-test-dir = "0.2.0" +target-test-dir = "0.3.0" diff --git a/tests/repos.rs b/tests/repos.rs index 64f3799..fe11ab9 100644 --- a/tests/repos.rs +++ b/tests/repos.rs @@ -1,11 +1,12 @@ use std::fs; -use std::path::PathBuf; -use target_test_dir::test_with_dir; +use target_test_dir::with_test_dir; mod helpers; -#[test_with_dir] -fn nonexistent(root: PathBuf) { +#[test] +#[with_test_dir] +fn nonexistent() { + let root = get_test_dir!(); helpers::prepare_root(&root); assert_eq!( "repo_state=NotFound\n", @@ -13,8 +14,10 @@ fn nonexistent(root: PathBuf) { ); } -#[test_with_dir] -fn empty(root: PathBuf) { +#[test] +#[with_test_dir] +fn empty() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -44,8 +47,10 @@ fn empty(root: PathBuf) { ); } -#[test_with_dir] -fn empty_untracked(root: PathBuf) { +#[test] +#[with_test_dir] +fn empty_untracked() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -76,8 +81,10 @@ fn empty_untracked(root: PathBuf) { ); } -#[test_with_dir] -fn empty_added(root: PathBuf) { +#[test] +#[with_test_dir] +fn empty_added() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -109,8 +116,10 @@ fn empty_added(root: PathBuf) { ); } -#[test_with_dir] -fn empty_untracked_added(root: PathBuf) { +#[test] +#[with_test_dir] +fn empty_untracked_added() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -143,8 +152,10 @@ fn empty_untracked_added(root: PathBuf) { ); } -#[test_with_dir] -fn commit(root: PathBuf) { +#[test] +#[with_test_dir] +fn commit() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -175,8 +186,10 @@ fn commit(root: PathBuf) { ); } -#[test_with_dir] -fn commit_delete(root: PathBuf) { +#[test] +#[with_test_dir] +fn commit_delete() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -208,8 +221,10 @@ fn commit_delete(root: PathBuf) { ); } -#[test_with_dir] -fn commit_delete_staged(root: PathBuf) { +#[test] +#[with_test_dir] +fn commit_delete_staged() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -241,8 +256,10 @@ fn commit_delete_staged(root: PathBuf) { ); } -#[test_with_dir] -fn commit_modified(root: PathBuf) { +#[test] +#[with_test_dir] +fn commit_modified() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -274,8 +291,10 @@ fn commit_modified(root: PathBuf) { ); } -#[test_with_dir] -fn commit_modified_staged(root: PathBuf) { +#[test] +#[with_test_dir] +fn commit_modified_staged() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -308,8 +327,10 @@ fn commit_modified_staged(root: PathBuf) { ); } -#[test_with_dir] -fn detached(root: PathBuf) { +#[test] +#[with_test_dir] +fn detached() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -338,8 +359,10 @@ fn detached(root: PathBuf) { ); } -#[test_with_dir] -fn branch(root: PathBuf) { +#[test] +#[with_test_dir] +fn branch() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -371,8 +394,10 @@ fn branch(root: PathBuf) { ); } -#[test_with_dir] -fn sym_ref(root: PathBuf) { +#[test] +#[with_test_dir] +fn sym_ref() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -415,8 +440,10 @@ fn sym_ref(root: PathBuf) { } // Tags are actually just a detached HEAD. Including because why not. -#[test_with_dir] -fn tag(root: PathBuf) { +#[test] +#[with_test_dir] +fn tag() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -446,8 +473,10 @@ fn tag(root: PathBuf) { ); } -#[test_with_dir] -fn cherry_pick(root: PathBuf) { +#[test] +#[with_test_dir] +fn cherry_pick() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -484,8 +513,10 @@ fn cherry_pick(root: PathBuf) { ); } -#[test_with_dir] -fn cherry_pick_staged(root: PathBuf) { +#[test] +#[with_test_dir] +fn cherry_pick_staged() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -524,8 +555,10 @@ fn cherry_pick_staged(root: PathBuf) { ); } -#[test_with_dir] -fn cherry_pick_unstaged(root: PathBuf) { +#[test] +#[with_test_dir] +fn cherry_pick_unstaged() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -565,8 +598,10 @@ fn cherry_pick_unstaged(root: PathBuf) { ); } -#[test_with_dir] -fn conflict(root: PathBuf) { +#[test] +#[with_test_dir] +fn conflict() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "repo"); @@ -603,8 +638,10 @@ fn conflict(root: PathBuf) { ); } -#[test_with_dir] -fn bare(root: PathBuf) { +#[test] +#[with_test_dir] +fn bare() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "upstream"); @@ -636,8 +673,10 @@ fn bare(root: PathBuf) { ); } -#[test_with_dir] -fn ahead_1(root: PathBuf) { +#[test] +#[with_test_dir] +fn ahead_1() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "upstream"); @@ -670,8 +709,10 @@ fn ahead_1(root: PathBuf) { ); } -#[test_with_dir] -fn ahead_1_behind_1(root: PathBuf) { +#[test] +#[with_test_dir] +fn ahead_1_behind_1() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "upstream"); @@ -706,8 +747,10 @@ fn ahead_1_behind_1(root: PathBuf) { ); } -#[test_with_dir] -fn behind_1(root: PathBuf) { +#[test] +#[with_test_dir] +fn behind_1() { + let root = get_test_dir!(); helpers::prepare_root(&root); helpers::git_init(&root, "upstream");