Add gen test for #5176

This commit is contained in:
Ayaz Hafiz 2023-03-25 13:58:40 -05:00
parent aef21741ec
commit 628fd6a49f
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -4312,3 +4312,26 @@ fn function_specialization_information_in_lambda_set_thunk_independent_defs() {
u8
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn when_guard_appears_multiple_times_in_compiled_decision_tree_issue_5176() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
go : U8 -> U8
go = \byte ->
when byte is
15 if Bool.true -> 1
b if Bool.true -> b + 2
_ -> 3
main = go '.'
"#
),
'.' as u8 + 2,
u8
)
}