mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
add failing test
This commit is contained in:
parent
f7c1a6e952
commit
267f88626f
1 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue