We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
assert_not_contains
run-make-support
1 parent 21e6de7 commit 24cbae8Copy full SHA for 24cbae8
src/tools/run-make-support/src/lib.rs
@@ -201,6 +201,17 @@ pub fn set_host_rpath(cmd: &mut Command) {
201
});
202
}
203
204
+/// Check that `haystack` does not contain `needle`. Panic otherwise.
205
+pub fn assert_not_contains(haystack: &str, needle: &str) {
206
+ if haystack.contains(needle) {
207
+ eprintln!("=== HAYSTACK ===");
208
+ eprintln!("{}", haystack);
209
+ eprintln!("=== NEEDLE ===");
210
+ eprintln!("{}", needle);
211
+ panic!("needle was unexpectedly found in haystack");
212
+ }
213
+}
214
+
215
/// Implement common helpers for command wrappers. This assumes that the command wrapper is a struct
216
/// containing a `cmd: Command` field and a `output` function. The provided helpers are:
217
///
0 commit comments