Skip to content

Commit 3ff6d9e

Browse files
committed
Add built-in alias shadowing not warning test
1 parent 444af48 commit 3ff6d9e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/testsuite/cargo_alias_config.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,30 @@ fn dependent_alias() {
150150
.run();
151151
}
152152

153+
#[cargo_test]
154+
fn builtin_alias_shadowing_external_subcommand() {
155+
let p = project()
156+
.file("Cargo.toml", &basic_bin_manifest("foo"))
157+
.file("src/main.rs", "fn main() {}")
158+
.executable("cargo-t", "")
159+
.build();
160+
161+
let mut paths: Vec<_> = env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect();
162+
paths.push(p.root());
163+
let path = env::join_paths(paths).unwrap();
164+
165+
p.cargo("t")
166+
.env("PATH", &path)
167+
.with_stderr(
168+
"\
169+
[COMPILING] foo v0.5.0 [..]
170+
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
171+
[RUNNING] unittests src/main.rs [..]
172+
",
173+
)
174+
.run();
175+
}
176+
153177
#[cargo_test]
154178
fn alias_shadowing_external_subcommand() {
155179
let echo = echo_subcommand();

0 commit comments

Comments
 (0)