Skip to content

Commit

Permalink
Add built-in alias shadowing not warning test
Browse files Browse the repository at this point in the history
  • Loading branch information
basile-henry committed Oct 13, 2022
1 parent 7e328ca commit 5cedfbb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testsuite/cargo_alias_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,30 @@ fn dependent_alias() {
.run();
}

#[cargo_test]
fn builtin_alias_shadowing_external_subcommand() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.file("src/main.rs", "fn main() {}")
.executable("cargo-t", "")
.build();

let mut paths: Vec<_> = env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect();
paths.push(p.root());
let path = env::join_paths(paths).unwrap();

p.cargo("t")
.env("PATH", &path)
.with_stderr(
"\
[COMPILING] foo v0.5.0 [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] unittests src/main.rs [..]
",
)
.run();
}

#[cargo_test]
fn alias_shadowing_external_subcommand() {
let echo = echo_subcommand();
Expand Down

0 comments on commit 5cedfbb

Please sign in to comment.