From 35785e51af1a50c2180505bf4cfcf5d610aaec7b Mon Sep 17 00:00:00 2001 From: Douglas Wilson Date: Fri, 14 Jun 2024 12:40:53 +0100 Subject: [PATCH] test: add a test for sum type tags --- .../hugr_llvm__types__test__sum_type_to_llvm@llvm14_3.snap | 5 +++++ src/types.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 src/snapshots/hugr_llvm__types__test__sum_type_to_llvm@llvm14_3.snap diff --git a/src/snapshots/hugr_llvm__types__test__sum_type_to_llvm@llvm14_3.snap b/src/snapshots/hugr_llvm__types__test__sum_type_to_llvm@llvm14_3.snap new file mode 100644 index 0000000..695c5e8 --- /dev/null +++ b/src/snapshots/hugr_llvm__types__test__sum_type_to_llvm@llvm14_3.snap @@ -0,0 +1,5 @@ +--- +source: src/types.rs +expression: "[]+[]" +--- +"{ i32, {}, {} }" diff --git a/src/types.rs b/src/types.rs index df2fe71..ea6fb4a 100644 --- a/src/types.rs +++ b/src/types.rs @@ -364,6 +364,7 @@ pub mod test { #[case(0, SumType::new_unary(0))] #[case(1, SumType::new_unary(1))] #[case(2,SumType::new([vec![Type::new_unit_sum(0), Type::new_unit_sum(1)], vec![Type::new_unit_sum(2), Type::new_unit_sum(3)]]))] + #[case(3, SumType::new_unary(2))] fn sum_types(#[case] _id: i32, #[with(_id)] llvm_ctx: TestContext, #[case] st: SumType) { llvm_ctx.with_tsesh(|tsesh| { assert_snapshot!(