Skip to content

Commit a15b94a

Browse files
committed
Update test
1 parent c3c5dfc commit a15b94a

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

tests/testsuite/cargo_tree/deps.rs

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,7 @@ foo v0.1.0 ([ROOT]/foo)
13071307
fn host_dep_feature() {
13081308
// New feature resolver with optional build dep
13091309
Package::new("optdep", "1.0.0").publish();
1310+
Package::new("optdep", "2.0.0").publish();
13101311
Package::new("bar", "1.0.0")
13111312
.add_dep(Dependency::new("optdep", "1.0").optional(true))
13121313
.publish();
@@ -1318,11 +1319,9 @@ fn host_dep_feature() {
13181319
name = "foo"
13191320
version = "0.1.0"
13201321
1321-
[build-dependencies]
1322-
bar = { version = "1.0", features = ["optdep"] }
1323-
13241322
[dependencies]
1325-
bar = "1.0"
1323+
optdep = "2.0"
1324+
bar = { version = "1.0", features = ["optdep"] }
13261325
"#,
13271326
)
13281327
.file("src/lib.rs", "")
@@ -1333,10 +1332,9 @@ fn host_dep_feature() {
13331332
p.cargo("tree")
13341333
.with_stdout_data(str![[r#"
13351334
foo v0.1.0 ([ROOT]/foo)
1336-
└── bar v1.0.0
1337-
└── optdep v1.0.0
1338-
[build-dependencies]
1339-
└── bar v1.0.0 (*)
1335+
├── bar v1.0.0
1336+
│ └── optdep v1.0.0
1337+
└── optdep v2.0.0
13401338
13411339
"#]])
13421340
.run();
@@ -1351,13 +1349,11 @@ bar v1.0.0
13511349
.run();
13521350

13531351
// invert
1354-
p.cargo("tree -i optdep")
1352+
p.cargo("tree -i optdep@1.0.0")
13551353
.with_stdout_data(str![[r#"
13561354
optdep v1.0.0
13571355
└── bar v1.0.0
13581356
└── foo v0.1.0 ([ROOT]/foo)
1359-
[build-dependencies]
1360-
└── foo v0.1.0 ([ROOT]/foo)
13611357
13621358
"#]])
13631359
.run();
@@ -1368,42 +1364,38 @@ optdep v1.0.0
13681364
p.cargo("tree")
13691365
.with_stdout_data(str![[r#"
13701366
foo v0.1.0 ([ROOT]/foo)
1371-
└── bar v1.0.0
1372-
[build-dependencies]
1373-
└── bar v1.0.0
1374-
└── optdep v1.0.0
1367+
├── bar v1.0.0
1368+
│ └── optdep v1.0.0
1369+
└── optdep v2.0.0
13751370
13761371
"#]])
13771372
.run();
13781373

13791374
p.cargo("tree -p bar")
13801375
.with_stdout_data(str![[r#"
13811376
bar v1.0.0
1382-
1383-
bar v1.0.0
13841377
└── optdep v1.0.0
13851378
13861379
"#]])
13871380
.run();
13881381

1389-
p.cargo("tree -i optdep")
1382+
p.cargo("tree -i optdep@1.0.0")
13901383
.with_stdout_data(str![[r#"
13911384
optdep v1.0.0
13921385
└── bar v1.0.0
1393-
[build-dependencies]
13941386
└── foo v0.1.0 ([ROOT]/foo)
13951387
13961388
"#]])
13971389
.run();
13981390

1399-
// Check that -d handles duplicates with features.
1391+
// Check that -d shows duplicates
14001392
p.cargo("tree -d")
14011393
.with_stdout_data(str![[r#"
1402-
bar v1.0.0
1403-
└── foo v0.1.0 ([ROOT]/foo)
1394+
optdep v1.0.0
1395+
└── bar v1.0.0
1396+
└── foo v0.1.0 ([ROOT]/foo)
14041397
1405-
bar v1.0.0
1406-
[build-dependencies]
1398+
optdep v2.0.0
14071399
└── foo v0.1.0 ([ROOT]/foo)
14081400
14091401
"#]])

0 commit comments

Comments
 (0)