Skip to content

Commit

Permalink
test(tree): new incomplete test for cargo tree --depth workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoyuVanilla committed Dec 12, 2024
1 parent 4412b0a commit 1c0f6cf
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/testsuite/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,64 @@ c v1.0.0
.run();
}

#[cargo_test]
fn depth_workspace() {
Package::new("somedep", "1.0.0").publish();
Package::new("otherdep", "1.0.0").publish();
let p = project()
.file(
"Cargo.toml",
r#"
[workspace]
members = ["a", "b", "c"]
"#,
)
.file("a/Cargo.toml", &basic_manifest("a", "1.0.0"))
.file("a/src/lib.rs", "")
.file(
"b/Cargo.toml",
r#"
[package]
name = "b"
version = "0.1.0"
[dependencies]
c = { path = "../c" }
somedep = "1"
"#,
)
.file("b/src/lib.rs", "")
.file(
"c/Cargo.toml",
r#"
[package]
name = "c"
version = "0.1.0"
[dependencies]
somedep = "1"
otherdep = "1"
"#,
)
.file("c/src/lib.rs", "")
.build();

p.cargo("tree")
.with_stdout_data(str![[r#"
a v1.0.0 ([ROOT]/foo/a)
b v0.1.0 ([ROOT]/foo/b)
├── c v0.1.0 ([ROOT]/foo/c)
│ ├── otherdep v1.0.0
│ └── somedep v1.0.0
└── somedep v1.0.0
c v0.1.0 ([ROOT]/foo/c) (*)
"#]])
.run();
}

#[cargo_test]
fn prune() {
let p = make_simple_proj();
Expand Down

0 comments on commit 1c0f6cf

Please sign in to comment.