Skip to content

Commit

Permalink
test: add test for install with dry-run option
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowrey committed Jul 21, 2024
1 parent 631b877 commit 146b383
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 50 deletions.
102 changes: 52 additions & 50 deletions tests/testsuite/cargo_install/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2730,3 +2730,20 @@ fn uninstall_running_binary() {
"#]]).run();
}

#[cargo_test]
fn dry_run() {
pkg("foo", "0.0.1");

cargo_process("-Z unstable-options install --dry-run foo")
.masquerade_as_nightly_cargo(&["install::dry-run"])
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[DOWNLOADING] crates ...
[DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
[INSTALLING] foo v0.0.1
"#]])
.run();
assert_has_not_installed_exe(paths::cargo_home(), "foo");
}

0 comments on commit 146b383

Please sign in to comment.