Skip to content

Commit

Permalink
Remove allowed_warnings when asserting empty warnings
Browse files Browse the repository at this point in the history
This commit fixes a small bug in the yaml_test_runner
whereby the allowed_warnings should be removed from
the seen warnings before asserting that they are empty.
  • Loading branch information
russcam committed Jul 1, 2020
1 parent e3ec678 commit f49c7d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yaml_test_runner/src/step/do.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ impl Do {
});
}
} else if !self.allowed_warnings.is_empty() {
let allowed = &self.allowed_warnings;
tokens.append(quote! {
let warnings: Vec<&str> = response.warning_headers().collect();
let allowed_warnings = vec![#(#allowed),*];
let warnings: Vec<&str> = response.warning_headers()
.filter(|w| !allowed_warnings.iter().any(|a| w.contains(a)))
.collect();
assert_warnings_is_empty!(warnings);
});
}
Expand Down

0 comments on commit f49c7d5

Please sign in to comment.