Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Dec 28, 2024
1 parent e77c173 commit d00e21d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/tests/commands.rs
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion test_cmd/restore.in/qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": [
{
"id": "scotland2",
"versionRange": "^0.1.4",
"versionRange": "=0.1.4",
"additionalData": {}
}
]
Expand Down
2 changes: 1 addition & 1 deletion test_cmd/restore.out/qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": [
{
"id": "scotland2",
"versionRange": "^0.1.4",
"versionRange": "=0.1.4",
"additionalData": {}
}
]
Expand Down
2 changes: 1 addition & 1 deletion test_cmd/restore.out/qpm.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": [
{
"id": "scotland2",
"versionRange": "^0.1.4",
"versionRange": "=0.1.4",
"additionalData": {}
}
]
Expand Down
1 change: 1 addition & 0 deletions tests_dump.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$ENV:TRYCMD="dump"
& cargo build --bin qpm
& cargo test --bin qpm -- tests::commands::trycmd -- --nocapture
$ENV:TRYCMD=""
1 change: 1 addition & 0 deletions tests_update.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$ENV:TRYCMD="overwrite"
& cargo build --bin qpm
& cargo test --bin qpm -- tests::commands::trycmd -- --nocapture
$ENV:TRYCMD=""

0 comments on commit d00e21d

Please sign in to comment.