Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 146b383

Browse files
committedJul 21, 2024
test: add test for install with dry-run option
1 parent 631b877 commit 146b383

File tree

2 files changed

+69
-50
lines changed

2 files changed

+69
-50
lines changed
 

‎tests/testsuite/cargo_install/help/stdout.term.svg

+52-50
Loading

‎tests/testsuite/install.rs

+17
Original file line numberDiff line numberDiff line change
@@ -2730,3 +2730,20 @@ fn uninstall_running_binary() {
27302730
27312731
"#]]).run();
27322732
}
2733+
2734+
#[cargo_test]
2735+
fn dry_run() {
2736+
pkg("foo", "0.0.1");
2737+
2738+
cargo_process("-Z unstable-options install --dry-run foo")
2739+
.masquerade_as_nightly_cargo(&["install::dry-run"])
2740+
.with_stderr_data(str![[r#"
2741+
[UPDATING] `dummy-registry` index
2742+
[DOWNLOADING] crates ...
2743+
[DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
2744+
[INSTALLING] foo v0.0.1
2745+
2746+
"#]])
2747+
.run();
2748+
assert_has_not_installed_exe(paths::cargo_home(), "foo");
2749+
}

0 commit comments

Comments
 (0)
Please sign in to comment.