Skip to content

Commit

Permalink
Fix cfg_children_restrictions test in a different way (instantiate_ex…
Browse files Browse the repository at this point in the history
…tensions)
  • Loading branch information
acl-cqc committed Oct 25, 2023
1 parent bb79165 commit 111335a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hugr/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,9 @@ mod test {
.map_into()
.collect_tuple()
.unwrap();
let mut closure = b.infer_extensions().unwrap();
assert!(closure.remove(&copy).is_some());
let closure = b.infer_extensions().unwrap();
b.instantiate_extensions(closure);
b.validate(&EMPTY_REG).unwrap();
b.replace_op(
copy,
NodeType::pure(ops::CFG {
Expand All @@ -1010,7 +1011,7 @@ mod test {
// (i.e. update_and_validate) on such a malformed Hugr, and pure `validate(&EMPTY_REG)`
// fails because of missing extension annotations (contained in the closure)
assert_matches!(
b.validate_with_extension_closure(closure, &EMPTY_REG),
b.validate(&EMPTY_REG),
Err(ValidationError::ContainerWithoutChildren { .. })
);
let cfg = copy;
Expand Down

0 comments on commit 111335a

Please sign in to comment.