Skip to content

Commit

Permalink
test: migrate warn_on_failure to snapbox
Browse files Browse the repository at this point in the history
  • Loading branch information
eth3lbert committed Jul 5, 2024
1 parent 2d01f40 commit b11e741
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tests/testsuite/warn_on_failure.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Tests for whether or not warnings are displayed for build scripts.

#![allow(deprecated)]

use cargo_test_support::registry::Package;
use cargo_test_support::{project, Project};
use cargo_test_support::{project, str, Project};

static WARNING1: &str = "Hello! I'm a warning. :)";
static WARNING2: &str = "And one more!";
Expand Down Expand Up @@ -65,20 +63,20 @@ fn no_warning_on_success() {
let upstream = make_upstream("");
upstream
.cargo("build")
.with_stderr(
"\
[UPDATING] `[..]` index
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.0.1 ([..])
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
[COMPILING] bar v0.0.1
[COMPILING] foo v0.0.1 ([..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
",
)
[COMPILING] foo v0.0.1 ([ROOT]/foo)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
"#]])
.run();
}

#[allow(deprecated)]
#[cargo_test]
fn no_warning_on_bin_failure() {
make_lib("");
Expand All @@ -97,6 +95,7 @@ fn no_warning_on_bin_failure() {
.run();
}

#[allow(deprecated)]
#[cargo_test]
fn warning_on_lib_failure() {
make_lib("err()");
Expand Down

0 comments on commit b11e741

Please sign in to comment.