Skip to content

Commit

Permalink
Merge pull request #211 from stepchowfun/flaky-tests
Browse files Browse the repository at this point in the history
Fix a couple of flaky tests
  • Loading branch information
stepchowfun authored Feb 21, 2024
2 parents c27923a + 4669223 commit a80b2c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
17 changes: 12 additions & 5 deletions src/duplicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,17 @@ mod tests {

let errors = check(&tags_map);
assert_eq!(errors.len(), 2);
assert!(errors[0].contains(&format!("{}", tags_vec2[0])));
assert!(errors[0].contains(&format!("{}", tags_vec2[1])));
assert!(errors[1].contains(&format!("{}", tags_vec3[0])));
assert!(errors[1].contains(&format!("{}", tags_vec3[1])));
assert!(errors[1].contains(&format!("{}", tags_vec3[2])));
assert!(
(errors[0].contains(&format!("{}", tags_vec2[0]))
&& errors[0].contains(&format!("{}", tags_vec2[1]))
&& errors[1].contains(&format!("{}", tags_vec3[0]))
&& errors[1].contains(&format!("{}", tags_vec3[1]))
&& errors[1].contains(&format!("{}", tags_vec3[2])))
|| (errors[0].contains(&format!("{}", tags_vec3[0]))
&& errors[0].contains(&format!("{}", tags_vec3[1]))
&& errors[0].contains(&format!("{}", tags_vec3[2]))
&& errors[1].contains(&format!("{}", tags_vec2[0]))
&& errors[1].contains(&format!("{}", tags_vec2[1]))),
);
}
}
6 changes: 4 additions & 2 deletions src/tag_references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ mod tests {

let errors = check(&tags, &refs);
assert_eq!(errors.len(), 2);
assert!(errors[0].contains(&refs[1].label));
assert!(errors[1].contains(&refs[2].label));
assert!(
(errors[0].contains(&refs[1].label) && errors[1].contains(&refs[2].label))
|| (errors[0].contains(&refs[2].label) && errors[1].contains(&refs[1].label)),
);
}
}

0 comments on commit a80b2c7

Please sign in to comment.