Skip to content

Commit

Permalink
tests: Add more tests for looping CFGs
Browse files Browse the repository at this point in the history
  • Loading branch information
croyzor committed Oct 9, 2023
1 parent ca22387 commit afcbf9b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/extension/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,18 +1590,14 @@ mod test {
#[test]
fn test_cfg_loops() -> Result<(), Box<dyn Error>> {
let just_a = ExtensionSet::singleton(&A);
let variants = vec![
(
ExtensionSet::new(),
ExtensionSet::new(),
ExtensionSet::new(),
),
(just_a.clone(), ExtensionSet::new(), ExtensionSet::new()),
(ExtensionSet::new(), just_a.clone(), ExtensionSet::new()),
(ExtensionSet::new(), ExtensionSet::new(), just_a.clone()),
(ExtensionSet::new(), just_a.clone(), just_a.clone()),
];

let mut variants = Vec::new();
for entry in [ExtensionSet::new(), just_a.clone()] {
for bb1 in [ExtensionSet::new(), just_a.clone()] {
for bb2 in [ExtensionSet::new(), just_a.clone()] {
variants.push((entry.clone(), bb1.clone(), bb2.clone()));
}
}
}
for (bb0, bb1, bb2) in variants.into_iter() {
let mut hugr = make_looping_cfg(bb0, bb1, bb2)?;
hugr.infer_and_validate(&PRELUDE_REGISTRY)?;
Expand Down

0 comments on commit afcbf9b

Please sign in to comment.