diff --git a/tests/run-make/link-dedup/rmake.rs b/tests/run-make/link-dedup/rmake.rs index b97a52eb595d4..f4c6c2e39708b 100644 --- a/tests/run-make/link-dedup/rmake.rs +++ b/tests/run-make/link-dedup/rmake.rs @@ -29,6 +29,11 @@ fn main() { assert!(output.contains("-ltesta")); let output = String::from_utf8(rustc().input("empty.rs").command_output().stderr).unwrap(); assert!(!output.contains("-ltestb")); - let output = String::from_utf8(rustc().input("empty.rs").command_output().stderr).unwrap(); - assert_eq!(output.matches("-ltesta").count(), 1); + let output = rustc().input("empty.rs").command_output().stderr; + let pattern = "\"-ltesta\" \"-ltesta\" \"-ltesta\""; + for window in output.windows(pattern.len()) { + if window == pattern { + panic!("ltesta was repeated too many times"); + } + } }