diff --git a/hugr-passes/src/const_fold/test.rs b/hugr-passes/src/const_fold/test.rs index 06ba4131c..b2d2edd15 100644 --- a/hugr-passes/src/const_fold/test.rs +++ b/hugr-passes/src/const_fold/test.rs @@ -124,10 +124,8 @@ fn test_big() { } #[test] -#[cfg_attr( - feature = "extension_inference", - ignore = "inference fails for test graph, it shouldn't" -)] +#[cfg(ignore = "Waiting for `unwrap` operation")] +// TODO: https://github.com/CQCL/hugr/issues/1486 fn test_list_ops() -> Result<(), Box> { use hugr_core::std_extensions::collections::{self, ListOp, ListValue}; @@ -137,28 +135,40 @@ fn test_list_ops() -> Result<(), Box> { collections::EXTENSION.to_owned(), ]) .unwrap(); - let list: Value = ListValue::new(BOOL_T, [Value::false_val()]).into(); - let mut build = - DFGBuilder::new(Signature::new(type_row![], vec![list.get_type().clone()])).unwrap(); - - let list_wire = build.add_load_const(list.clone()); - - let pop = build.add_dataflow_op( - ListOp::pop.with_type(BOOL_T).to_extension_op(®).unwrap(), - [list_wire], - )?; - - let push = build.add_dataflow_op( - ListOp::push - .with_type(BOOL_T) - .to_extension_op(®) - .unwrap(), - pop.outputs(), - )?; - let mut h = build.finish_hugr_with_outputs(push.outputs(), ®)?; + let base_list: Value = ListValue::new(BOOL_T, [Value::false_val()]).into(); + let mut build = DFGBuilder::new(Signature::new( + type_row![], + vec![base_list.get_type().clone()], + )) + .unwrap(); + + let list = build.add_load_const(base_list.clone()); + + let [list, maybe_elem] = build + .add_dataflow_op( + ListOp::pop.with_type(BOOL_T).to_extension_op(®).unwrap(), + [list], + )? + .outputs_arr(); + + // FIXME: Unwrap the Option + let elem = maybe_elem; + + let [list] = build + .add_dataflow_op( + ListOp::push + .with_type(BOOL_T) + .to_extension_op(®) + .unwrap(), + [list, elem], + )? + .outputs_arr(); + + let mut h = build.finish_hugr_with_outputs([list], ®)?; + constant_fold_pass(&mut h, ®); - assert_fully_folded(&h, &list); + assert_fully_folded(&h, &base_list); Ok(()) }