Skip to content

Commit 4fdd6ec

Browse files
committed
test: add test for no-proc-macro order issue
1 parent 5b295b7 commit 4fdd6ec

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

tests/testsuite/cargo_tree/deps.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,3 +2318,52 @@ foo v1.0.0 ([ROOT]/foo)
23182318
"#]])
23192319
.run();
23202320
}
2321+
2322+
#[cargo_test]
2323+
fn no_proc_macro_order() {
2324+
Package::new("dep", "1.0.0").publish();
2325+
Package::new("pm", "1.0.0").proc_macro(true).publish();
2326+
let p = project()
2327+
.file(
2328+
"Cargo.toml",
2329+
r#"
2330+
[package]
2331+
name = "foo"
2332+
version = "0.1.0"
2333+
2334+
[dependencies]
2335+
pm = "1.0"
2336+
dep = "1.0"
2337+
"#,
2338+
)
2339+
.file("src/lib.rs", "")
2340+
.build();
2341+
2342+
p.cargo("tree")
2343+
.with_stdout_data(str![[r#"
2344+
foo v0.1.0 ([ROOT]/foo)
2345+
├── dep v1.0.0
2346+
└── pm v1.0.0 (proc-macro)
2347+
2348+
"#]])
2349+
.run();
2350+
2351+
// no-proc-macro combined with other edge kinds
2352+
p.cargo("tree -e normal,no-proc-macro")
2353+
.with_stdout_data(str![[r#"
2354+
foo v0.1.0 ([ROOT]/foo)
2355+
└── dep v1.0.0
2356+
2357+
"#]])
2358+
.run();
2359+
2360+
// change flag order, no-proc-macro takes no effect if followed by other flags
2361+
p.cargo("tree -e no-proc-macro,normal")
2362+
.with_stdout_data(str![[r#"
2363+
foo v0.1.0 ([ROOT]/foo)
2364+
├── dep v1.0.0
2365+
└── pm v1.0.0 (proc-macro)
2366+
2367+
"#]])
2368+
.run();
2369+
}

0 commit comments

Comments
 (0)