Skip to content

Commit

Permalink
run tests with validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Dec 18, 2024
1 parent f61ef78 commit 4b1031f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions hugr-passes/src/monomorphize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,7 @@ mod test {
let [i1] = dfg_builder.input_wires_arr();
let hugr = dfg_builder.finish_hugr_with_outputs([i1]).unwrap();
let mut hugr2 = hugr.clone();
MonomorphizePass::default()
.run_no_validate(&mut hugr2)
.unwrap();
MonomorphizePass::default().run(&mut hugr2).unwrap();
assert_eq!(hugr, hugr2);
}

Expand Down Expand Up @@ -472,7 +470,7 @@ mod test {
.count(),
3
);
MonomorphizePass::default().run_no_validate(&mut hugr)?;
MonomorphizePass::default().run(&mut hugr)?;
let mono = hugr;
mono.validate()?;

Expand All @@ -493,7 +491,7 @@ mod test {
["double", "main", "triple"]
);
let mut mono2 = mono.clone();
MonomorphizePass::default().run_no_validate(&mut mono2)?;
MonomorphizePass::default().run(&mut mono2)?;

assert_eq!(mono2, mono); // Idempotent

Expand Down Expand Up @@ -600,9 +598,7 @@ mod test {
.outputs_arr();
let mut hugr = outer.finish_hugr_with_outputs([e1, e2]).unwrap();

MonomorphizePass::default()
.run_no_validate(&mut hugr)
.unwrap();
MonomorphizePass::default().run(&mut hugr).unwrap();
let mono_hugr = hugr;
mono_hugr.validate().unwrap();
let funcs = list_funcs(&mono_hugr);
Expand Down Expand Up @@ -663,7 +659,7 @@ mod test {
let mono = mono.finish_with_outputs([a, b]).unwrap();
let c = dfg.call(mono.handle(), &[], dfg.input_wires()).unwrap();
let mut hugr = dfg.finish_hugr_with_outputs(c.outputs()).unwrap();
MonomorphizePass::default().run_no_validate(&mut hugr)?;
MonomorphizePass::default().run(&mut hugr)?;
let mono_hugr = hugr;

let mut funcs = list_funcs(&mono_hugr);
Expand Down Expand Up @@ -720,9 +716,7 @@ mod test {
module_builder.finish_hugr().unwrap()
};

MonomorphizePass::default()
.run_no_validate(&mut hugr)
.unwrap();
MonomorphizePass::default().run(&mut hugr).unwrap();
remove_polyfuncs_ref(&mut hugr);

let funcs = list_funcs(&hugr);
Expand Down

0 comments on commit 4b1031f

Please sign in to comment.