You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per #228, this test creates a cyclic DAG but validation is "happy":
#[test]
fn test_cyclic() -> Result<(), HugrError> {
let mut h = Hugr::new(NodeType::pure(ops::DFG {
signature: FunctionType::new(type_row![QB_T], type_row![QB_T]),
}));
let input = h.add_op_with_parent(h.root(), ops::Input::new(type_row![QB_T]))?;
let output = h.add_op_with_parent(h.root(), ops::Output::new(type_row![QB_T]))?;
let cx = h.add_op_with_parent(h.root(), cx_gate())?;
h.connect(input, 0, cx, 0)?;
h.connect(cx, 0, output, 0)?;
h.connect(cx, 1, cx, 1)?;
h.validate().unwrap(); // TODO this should raise an error
Ok(())
}
Instead we should probably get a ValidationError::NotABoundedDag (or perhaps a new error, but anything cyclic clearly isn't any sort of DAG bounded or otherwise)
The text was updated successfully, but these errors were encountered:
As per #228, this test creates a cyclic DAG but validation is "happy":
Instead we should probably get a
ValidationError::NotABoundedDag
(or perhaps a new error, but anything cyclic clearly isn't any sort of DAG bounded or otherwise)The text was updated successfully, but these errors were encountered: