Skip to content

Commit 36bf7f6

Browse files
committed
Add a test for the cargo tree --all warning.
1 parent b118df4 commit 36bf7f6

File tree

1 file changed

+31
-0
lines changed
  • tests/testsuite/cargo_tree/dupe

1 file changed

+31
-0
lines changed

tests/testsuite/cargo_tree/dupe/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::prelude::*;
22
use cargo_test_support::file;
33
use cargo_test_support::project;
44
use cargo_test_support::registry::Package;
5+
use cargo_test_support::str;
56

67
#[cargo_test]
78
fn case() {
@@ -34,3 +35,33 @@ fn case() {
3435
.stdout_eq(file!["stdout.term.svg"])
3536
.stderr_eq(file!["stderr.term.svg"]);
3637
}
38+
39+
#[cargo_test]
40+
fn all_flag() {
41+
Package::new("a", "1.0.0").dep("b", "1.0").publish();
42+
Package::new("b", "1.0.0").dep("c", "1.0").publish();
43+
Package::new("c", "1.0.0").publish();
44+
45+
let p = project()
46+
.file(
47+
"Cargo.toml",
48+
r#"
49+
[package]
50+
name = "foo"
51+
version = "0.1.0"
52+
53+
[dependencies]
54+
a = "1.0"
55+
b = "1.0"
56+
"#,
57+
)
58+
.file("src/lib.rs", "")
59+
.file("build.rs", "fn main() {}")
60+
.build();
61+
62+
p.cargo("tree --all").with_stderr_data(str![[r#"
63+
[WARNING] The `cargo tree` --all flag has been changed to --no-dedupe, and may be removed in a future version.
64+
If you are looking to display all workspace members, use the --workspace flag.
65+
...
66+
"#]]).run();
67+
}

0 commit comments

Comments
 (0)