Skip to content

Commit 3e59d08

Browse files
torhovlandehuss
authored andcommitted
test: Update to snapshot style.
1 parent 198c1d8 commit 3e59d08

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

tests/testsuite/warn_on_failure.rs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,18 @@ fn no_warning_on_bin_failure() {
8686
.cargo("build")
8787
.with_status(101)
8888
.with_stdout_does_not_contain("hidden stdout")
89-
.with_stderr_does_not_contain("hidden stderr")
90-
.with_stderr_does_not_contain(&format!("[WARNING] {}", WARNING1))
91-
.with_stderr_does_not_contain(&format!("[WARNING] {}", WARNING2))
92-
.with_stderr_contains("[UPDATING] `[..]` index")
93-
.with_stderr_contains("[DOWNLOADED] bar v0.0.1 ([..])")
94-
.with_stderr_contains("[COMPILING] bar v0.0.1")
95-
.with_stderr_contains("[COMPILING] foo v0.0.1 ([..])")
89+
.with_stderr_data(str![[r#"
90+
[UPDATING] `dummy-registry` index
91+
[LOCKING] 2 packages to latest compatible versions
92+
[DOWNLOADING] crates ...
93+
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
94+
[COMPILING] bar v0.0.1
95+
[COMPILING] foo v0.0.1 ([ROOT]/foo)
96+
error[E0425]: cannot find function `hi` in this scope
97+
...
98+
[ERROR] could not compile `foo` (bin "foo") due to 1 previous error
99+
100+
"#]])
96101
.run();
97102
}
98103

@@ -105,12 +110,21 @@ fn warning_on_lib_failure() {
105110
.cargo("build")
106111
.with_status(101)
107112
.with_stdout_does_not_contain("hidden stdout")
108-
.with_stderr_does_not_contain("hidden stderr")
109-
.with_stderr_does_not_contain("[COMPILING] foo v0.0.1 ([..])")
110-
.with_stderr_contains("[UPDATING] `[..]` index")
111-
.with_stderr_contains("[DOWNLOADED] bar v0.0.1 ([..])")
112-
.with_stderr_contains("[COMPILING] bar v0.0.1")
113-
.with_stderr_contains(&format!("[WARNING] [email protected]: {}", WARNING1))
114-
.with_stderr_contains(&format!("[WARNING] [email protected]: {}", WARNING2))
113+
.with_stderr_data(str![[r#"
114+
[UPDATING] `dummy-registry` index
115+
[LOCKING] 2 packages to latest compatible versions
116+
[DOWNLOADING] crates ...
117+
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
118+
[COMPILING] bar v0.0.1
119+
error[E0425]: cannot find function `err` in this scope
120+
...
121+
The following warnings were emitted during compilation:
122+
123+
[WARNING] [email protected]: Hello! I'm a warning. :)
124+
[WARNING] [email protected]: And one more!
125+
126+
[ERROR] could not compile `bar` (lib) due to 1 previous error
127+
128+
"#]])
115129
.run();
116130
}

0 commit comments

Comments
 (0)