mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
test(alias): panic if alias is empty
This demonstrate the current bad behavior
This commit is contained in:
parent
f0ae765191
commit
352d8bbe8e
@ -429,3 +429,29 @@ To pass the arguments to the subcommand, remove `--`
|
|||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn empty_alias() {
|
||||||
|
let p = project()
|
||||||
|
.file("Cargo.toml", &basic_bin_manifest("foo"))
|
||||||
|
.file("src/main.rs", "fn main() {}")
|
||||||
|
.file(
|
||||||
|
".cargo/config.toml",
|
||||||
|
r#"
|
||||||
|
[alias]
|
||||||
|
string = ""
|
||||||
|
array = []
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
p.cargo("string")
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr_contains("[..]panicked at[..]")
|
||||||
|
.run();
|
||||||
|
|
||||||
|
p.cargo("array")
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr_contains("[..]panicked at[..]")
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user