Skip to content

Commit 7e78c54

Browse files
committed
initial test commit
1 parent b2c0aea commit 7e78c54

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/testsuite/bad_config.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,39 @@ fn bad_dependency() {
26412641
.run();
26422642
}
26432643

2644+
#[cargo_test]
2645+
fn bad_boolean_dependency() {
2646+
let p = project()
2647+
.file(
2648+
"Cargo.toml",
2649+
r#"
2650+
[package]
2651+
name = "foo"
2652+
version = "0.0.0"
2653+
edition = "2015"
2654+
authors = []
2655+
2656+
[dependencies]
2657+
bar = true
2658+
"#,
2659+
)
2660+
.file("src/lib.rs", "")
2661+
.build();
2662+
2663+
p.cargo("check")
2664+
.with_status(101)
2665+
.with_stderr_data(str![[r#"
2666+
[ERROR] invalid type: boolean `true`, expected a version string like "0.9.8" or a detailed dependency like { version = "0.9.8" }
2667+
--> Cargo.toml:9:23
2668+
|
2669+
9 | bar = true
2670+
| ^^^^
2671+
|
2672+
2673+
"#]])
2674+
.run();
2675+
}
2676+
26442677
#[cargo_test]
26452678
fn bad_debuginfo() {
26462679
let p = project()

0 commit comments

Comments
 (0)