From 23faf5c9168b6a39e3408071ae9848d3d6ea4806 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 12 Dec 2016 15:57:19 +0300 Subject: [PATCH] Add test for --package and virtual manifest closes #3194 --- tests/workspaces.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/workspaces.rs b/tests/workspaces.rs index 00bb68bd43d..579dfa0dbfe 100644 --- a/tests/workspaces.rs +++ b/tests/workspaces.rs @@ -624,6 +624,28 @@ fn virtual_works() { assert_that(&p.root().join("bar/Cargo.lock"), is_not(existing_file())); } +#[test] +fn explicit_package_argument_works_with_virtual_manifest() { + let p = project("foo") + .file("Cargo.toml", r#" + [workspace] + members = ["bar"] + "#) + .file("bar/Cargo.toml", r#" + [project] + name = "bar" + version = "0.1.0" + authors = [] + "#) + .file("bar/src/main.rs", "fn main() {}"); + p.build(); + assert_that(p.cargo("build").cwd(p.root()).args(&["--package", "bar"]), + execs().with_status(0)); + assert_that(&p.root().join("Cargo.lock"), existing_file()); + assert_that(&p.bin("bar"), existing_file()); + assert_that(&p.root().join("bar/Cargo.lock"), is_not(existing_file())); +} + #[test] fn virtual_misconfigure() { let p = project("foo")