From 03d0fa524ca7c05efd9a7d517c45b52d8512e820 Mon Sep 17 00:00:00 2001 From: Folkert Date: Wed, 15 Sep 2021 23:25:08 +0200 Subject: [PATCH] add test --- compiler/test_gen/src/gen_primitives.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/test_gen/src/gen_primitives.rs b/compiler/test_gen/src/gen_primitives.rs index bbb50da944..2bb2880455 100644 --- a/compiler/test_gen/src/gen_primitives.rs +++ b/compiler/test_gen/src/gen_primitives.rs @@ -2782,3 +2782,24 @@ fn value_not_exposed_hits_panic() { i64 ); } + +#[test] +fn mix_function_and_closure() { + assert_evals_to!( + indoc!( + r#" + app "test" provides [ main ] to "./platform" + + foo = \x -> x + + bar = \y -> \_ -> y + + main : Str + main = + (if 1 == 1 then foo else (bar "nope nope nope")) "hello world" + "# + ), + RocStr::from_slice(b"hello world"), + RocStr + ); +}