From db313e54a2d7e719b609826ff2b090e761453c9d Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 4 Oct 2020 23:28:01 +0800 Subject: [PATCH] test(rustc): glob support for package selection --- tests/testsuite/rustc.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/testsuite/rustc.rs b/tests/testsuite/rustc.rs index 6708f4a30..a1c00a096 100644 --- a/tests/testsuite/rustc.rs +++ b/tests/testsuite/rustc.rs @@ -325,6 +325,26 @@ error: The argument '--package ' was provided more than once, \ .run(); } +#[cargo_test] +fn fail_with_glob() { + let p = project() + .file( + "Cargo.toml", + r#" + [workspace] + members = ["bar"] + "#, + ) + .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) + .file("bar/src/lib.rs", "pub fn bar() { break_the_build(); }") + .build(); + + p.cargo("rustc -p '*z'") + .with_status(101) + .with_stderr("[ERROR] Glob patterns on package selection are not supported.") + .run(); +} + #[cargo_test] fn rustc_with_other_profile() { let p = project()