handle the case where multiple instances of same error are expected on the same line

This commit is contained in:
Niko Matsakis 2012-04-05 20:58:23 -07:00
parent 2577bd9df3
commit ef566acb8e

View File

@ -246,7 +246,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
// is the ending point, and * represents ANSI color codes.
for line: str in str::split_char(procres.stderr, '\n') {
let mut was_expected = false;
vec::iteri(expected_errors) {|i, ee|
for vec::eachi(expected_errors) {|i, ee|
if !found_flags[i] {
#debug["prefix=%s ee.kind=%s ee.msg=%s line=%s",
prefixes[i], ee.kind, ee.msg, line];
@ -255,6 +255,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
str::contains(line, ee.msg)) {
found_flags[i] = true;
was_expected = true;
break;
}
}
}