Fix annotations matching themselves

This commit is contained in:
Oli Scherer 2022-05-25 16:11:37 +00:00
parent 23bbe2bce7
commit 21795f3ce4

View File

@ -257,6 +257,9 @@ pub fn check_annotations(
comments: &Comments,
) {
let unnormalized_stderr = std::str::from_utf8(unnormalized_stderr).unwrap();
// erase annotations from the stderr so they don't match themselves
let annotations = Regex::new(r"\s*//~.*").unwrap();
let unnormalized_stderr = annotations.replace(unnormalized_stderr, "");
let mut found_annotation = false;
if let Some((ref error_pattern, definition_line)) = comments.error_pattern {
if !unnormalized_stderr.contains(error_pattern) {