-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Test fix for #109, run tests in full in CI
The other tests only needed modified to fix a column number. The action was mysteriously only running one of the tests - I've fixed that. This should help prevent regressions for #109 and possibly others. I've verified they also failed prior to that patch.
- Loading branch information
1 parent
69ac491
commit 0b4c9ae
Showing
8 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
members = [ | ||
"tests/single-panic", | ||
"tests/custom-panic", | ||
"tests/name-collision", | ||
] | ||
resolver = "2" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "name-collision-test" | ||
version = "0.1.0" | ||
authors = ["Human Panic Authors <[email protected]>"] | ||
edition = "2018" | ||
|
||
[package.metadata.release] | ||
release = false | ||
|
||
[dependencies] | ||
human-panic = { path = "../.." } | ||
|
||
[dev-dependencies] | ||
snapbox = { version = "0.4.11", features = ["cmd"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use human_panic::setup_panic; | ||
|
||
#[derive(Debug, PartialEq)] | ||
struct Metadata { | ||
test: bool, | ||
} | ||
|
||
mod panic { | ||
pub fn what() {} | ||
} | ||
|
||
fn main() { | ||
panic::what(); | ||
let prev = Metadata { test: true }; | ||
|
||
setup_panic!(); | ||
|
||
let next = Metadata { test: false }; | ||
|
||
assert_ne!(prev, next); | ||
panic::what(); | ||
|
||
println!("A normal log message"); | ||
panic!("OMG EVERYTHING IS ON FIRE!!!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#[test] | ||
#[cfg_attr(debug_assertions, ignore)] | ||
fn release() { | ||
snapbox::cmd::Command::new(snapbox::cmd::cargo_bin!("name-collision-test")) | ||
.assert() | ||
.stderr_matches( | ||
"\ | ||
Well, this is embarrassing. | ||
name-collision-test had a problem and crashed. To help us diagnose the problem you can send us a crash report. | ||
We have generated a report file at \"[..].toml\". Submit an issue or email with the subject of \"name-collision-test Crash Report\" and include the report as an attachment. | ||
- Authors: Human Panic Authors <[email protected]> | ||
We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports. | ||
Thank you kindly! | ||
", | ||
) | ||
.code(101); | ||
} | ||
|
||
#[test] | ||
#[cfg_attr(not(debug_assertions), ignore)] | ||
fn debug() { | ||
snapbox::cmd::Command::new(snapbox::cmd::cargo_bin!("name-collision-test")) | ||
.assert() | ||
.stderr_matches( | ||
"\ | ||
thread 'main' panicked at 'OMG EVERYTHING IS ON FIRE!!!', tests/name-collision/src/main.rs:24:5 | ||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace | ||
", | ||
) | ||
.code(101); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters