diff --git a/src/tests/commands.rs b/src/tests/commands.rs index 4779aed..ca3b6d0 100644 --- a/src/tests/commands.rs +++ b/src/tests/commands.rs @@ -1,6 +1,16 @@ #[test] +#[cfg(feature = "cli")] fn trycmd() { + // #[cfg(test)] + // let bin = trycmd::cargo::cargo_bin!("qpm_cli"); + // #[cfg(not(test))] + let bin = trycmd::cargo::cargo_bin("qpm"); + + + assert!(bin.exists(), "Binary not found: {:?}", bin); + trycmd::TestCases::new() + .default_bin_path(bin) .case("README.md") .pass("test_cmd/*.toml") .pass("test_cmd/*.trycmd") diff --git a/test_cmd/restore.in/qpm.json b/test_cmd/restore.in/qpm.json index 7251fc3..1176679 100644 --- a/test_cmd/restore.in/qpm.json +++ b/test_cmd/restore.in/qpm.json @@ -18,7 +18,7 @@ "dependencies": [ { "id": "scotland2", - "versionRange": "^0.1.4", + "versionRange": "=0.1.4", "additionalData": {} } ] diff --git a/test_cmd/restore.out/qpm.json b/test_cmd/restore.out/qpm.json index 7251fc3..1176679 100644 --- a/test_cmd/restore.out/qpm.json +++ b/test_cmd/restore.out/qpm.json @@ -18,7 +18,7 @@ "dependencies": [ { "id": "scotland2", - "versionRange": "^0.1.4", + "versionRange": "=0.1.4", "additionalData": {} } ] diff --git a/test_cmd/restore.out/qpm.shared.json b/test_cmd/restore.out/qpm.shared.json index ac099a9..ec3b627 100644 --- a/test_cmd/restore.out/qpm.shared.json +++ b/test_cmd/restore.out/qpm.shared.json @@ -19,7 +19,7 @@ "dependencies": [ { "id": "scotland2", - "versionRange": "^0.1.4", + "versionRange": "=0.1.4", "additionalData": {} } ] diff --git a/tests_dump.ps1 b/tests_dump.ps1 index c35860c..42d0c5a 100644 --- a/tests_dump.ps1 +++ b/tests_dump.ps1 @@ -1,3 +1,4 @@ $ENV:TRYCMD="dump" +& cargo build --bin qpm & cargo test --bin qpm -- tests::commands::trycmd -- --nocapture $ENV:TRYCMD="" \ No newline at end of file diff --git a/tests_update.ps1 b/tests_update.ps1 index 951b7d4..4962978 100644 --- a/tests_update.ps1 +++ b/tests_update.ps1 @@ -1,3 +1,4 @@ $ENV:TRYCMD="overwrite" +& cargo build --bin qpm & cargo test --bin qpm -- tests::commands::trycmd -- --nocapture $ENV:TRYCMD=""