Skip to content

Commit

Permalink
Any clearer?
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Mar 19, 2024
1 parent 42a7d05 commit 521314e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions quantinuum-hugr/src/extension/infer/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,18 +797,20 @@ fn test_cfg_loops() -> Result<(), Box<dyn Error>> {
#[test]
#[cfg(feature = "extension_inference")]
fn test_validate_with_closure() -> Result<(), Box<dyn Error>> {
let hugr = make_looping_cfg(
let mut hugr = make_looping_cfg(
ExtensionSet::new(),
ExtensionSet::singleton(&A),
ExtensionSet::singleton(&B),
)?;
let soln = infer_extensions(&hugr)?;
hugr.validate_with_extension_closure(soln, &PRELUDE_REGISTRY)?;
let mut hugr = hugr.clone();
assert_matches!(
hugr.validate(&PRELUDE_REGISTRY),
Err(ValidationError::ExtensionError(_))
);

let immut = hugr.clone();
let soln = infer_extensions(&immut)?;
immut.validate_with_extension_closure(soln, &PRELUDE_REGISTRY)?;

hugr.update_validate(&PRELUDE_REGISTRY)?; // Solution written in, hence:
hugr.validate(&PRELUDE_REGISTRY)?;
Ok(())
Expand Down

0 comments on commit 521314e

Please sign in to comment.