Skip to content

Commit f2a4a3e

Browse files
committed
test(diagnostic): Show panic
1 parent e1ebce1 commit f2a4a3e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/testsuite/diagnostics.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use cargo_test_support::project;
2+
3+
#[cargo_test]
4+
fn dont_panic_on_render() {
5+
let p = project()
6+
.file(
7+
"Cargo.toml",
8+
r#"
9+
[package]
10+
name = "foo"
11+
version = "0.1.0"
12+
edition = "2021"
13+
[[bench.foo]]
14+
"#,
15+
)
16+
.file("src/lib.rs", "")
17+
.build();
18+
19+
p.cargo("check")
20+
.with_status(101)
21+
.with_stderr_contains("attempt to subtract with overflow")
22+
.run();
23+
}

tests/testsuite/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ mod cross_publish;
7979
mod custom_target;
8080
mod death;
8181
mod dep_info;
82+
mod diagnostics;
8283
mod direct_minimal_versions;
8384
mod directory;
8485
mod doc;

0 commit comments

Comments
 (0)