Skip to content

Commit 4c603ef

Browse files
committed
test: Update to snapshot style.
1 parent 6e5a746 commit 4c603ef

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

tests/testsuite/warn_on_failure.rs

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,19 @@ 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+
For more information about this error, try `rustc --explain E0425`.
99+
[ERROR] could not compile `foo` (bin "foo") due to 1 previous error
100+
101+
"#]])
96102
.run();
97103
}
98104

@@ -105,12 +111,21 @@ fn warning_on_lib_failure() {
105111
.cargo("build")
106112
.with_status(101)
107113
.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))
114+
.with_stderr_data(str![[r#"
115+
[UPDATING] `dummy-registry` index
116+
[LOCKING] 2 packages to latest compatible versions
117+
[DOWNLOADING] crates ...
118+
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
119+
[COMPILING] bar v0.0.1
120+
error[E0425]: cannot find function `err` in this scope
121+
...
122+
The following warnings were emitted during compilation:
123+
124+
[WARNING] [email protected]: Hello! I'm a warning. :)
125+
[WARNING] [email protected]: And one more!
126+
127+
[ERROR] could not compile `bar` (lib) due to 1 previous error
128+
129+
"#]])
115130
.run();
116131
}

0 commit comments

Comments
 (0)