Skip to content

Commit

Permalink
test: Add a test for #1257 (#1260)
Browse files Browse the repository at this point in the history
We take the opportunity to change the `ignore` in `hugr_validation_0` to
`should_panic`
  • Loading branch information
doug-q authored Jul 3, 2024
1 parent b965202 commit e596b39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions hugr-core/src/builder/tail_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,15 @@ mod test {

Ok(())
}

#[test]
#[should_panic] // issue 1257: When building a TailLoop, calling outputs_arr, you are given an OrderEdge "output wire"
fn tailloop_output_arr() {
let mut builder =
TailLoopBuilder::new(type_row![], type_row![], type_row![], ExtensionSet::new())
.unwrap();
let control = builder.add_load_value(Value::false_val());
let tailloop = builder.finish_with_outputs(control, []).unwrap();
let [] = tailloop.outputs_arr();
}
}
2 changes: 1 addition & 1 deletion hugr-core/src/hugr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ mod test {

#[test]
#[cfg_attr(miri, ignore)] // Opening files is not supported in (isolated) miri
#[ignore = "issue 1225: In serialization we do not distinguish between unknown CustomConst serialized value invalid but known CustomConst serialized values"]
#[should_panic] // issue 1225: In serialization we do not distinguish between unknown CustomConst serialized value invalid but known CustomConst serialized values"
fn hugr_validation_0() {
// https://github.com/CQCL/hugr/issues/1091 bad case
let mut hugr: Hugr = serde_json::from_reader(BufReader::new(
Expand Down

0 comments on commit e596b39

Please sign in to comment.