Skip to content

Commit b11e741

Browse files
committed
test: migrate warn_on_failure to snapbox
1 parent 2d01f40 commit b11e741

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tests/testsuite/warn_on_failure.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! Tests for whether or not warnings are displayed for build scripts.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::registry::Package;
6-
use cargo_test_support::{project, Project};
4+
use cargo_test_support::{project, str, Project};
75

86
static WARNING1: &str = "Hello! I'm a warning. :)";
97
static WARNING2: &str = "And one more!";
@@ -65,20 +63,20 @@ fn no_warning_on_success() {
6563
let upstream = make_upstream("");
6664
upstream
6765
.cargo("build")
68-
.with_stderr(
69-
"\
70-
[UPDATING] `[..]` index
66+
.with_stderr_data(str![[r#"
67+
[UPDATING] `dummy-registry` index
7168
[LOCKING] 2 packages to latest compatible versions
7269
[DOWNLOADING] crates ...
73-
[DOWNLOADED] bar v0.0.1 ([..])
70+
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
7471
[COMPILING] bar v0.0.1
75-
[COMPILING] foo v0.0.1 ([..])
76-
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
77-
",
78-
)
72+
[COMPILING] foo v0.0.1 ([ROOT]/foo)
73+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
74+
75+
"#]])
7976
.run();
8077
}
8178

79+
#[allow(deprecated)]
8280
#[cargo_test]
8381
fn no_warning_on_bin_failure() {
8482
make_lib("");
@@ -97,6 +95,7 @@ fn no_warning_on_bin_failure() {
9795
.run();
9896
}
9997

98+
#[allow(deprecated)]
10099
#[cargo_test]
101100
fn warning_on_lib_failure() {
102101
make_lib("err()");

0 commit comments

Comments
 (0)