add failing test

This commit is contained in:
Folkert 2021-09-26 13:05:45 +02:00
parent f7c1a6e952
commit 267f88626f

View file

@ -2906,3 +2906,30 @@ fn do_pass_bool_byte_closure_layout() {
RocStr
);
}
#[test]
fn call_that_needs_closure_parameter() {
// here both p2 is lifted to the top-level, which means that `list` must be
// passed to it from `manyAux`.
assert_evals_to!(
indoc!(
r#"
Step state a : [ Loop state, Done a ]
manyAux : List a -> [ Pair (Step (List a) (List a))]
manyAux = \list ->
p2 = \_ -> Pair (Done list)
p2 "foo"
manyAuxTest = (manyAux [ ]) == Pair (Loop [97])
runTest = \t -> if t then "PASS" else "FAIL"
runTest manyAuxTest
"#
),
RocStr::from_slice(b"FAIL"),
RocStr
);
}