add List.map RC tests

This commit is contained in:
Folkert 2022-05-06 16:39:05 +02:00
parent 61c2b20313
commit 0a2a43546c
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 157 additions and 0 deletions

View file

@ -1361,3 +1361,39 @@ fn opaque_assign_to_symbol() {
// "#
// )
// }
#[mono_test]
fn list_map_closure_borrows() {
indoc!(
r#"
app "test" provides [ out ] to "./platform"
list = [ Str.concat "lllllllllllllllllllllooooooooooong" "g" ]
example1 = List.map list \string -> Str.repeat string 2
out =
when List.get example1 0 is
Ok s -> s
Err _ -> "Hello, World!\n"
"#
)
}
#[mono_test]
fn list_map_closure_owns() {
indoc!(
r#"
app "test" provides [ out ] to "./platform"
list = [ Str.concat "lllllllllllllllllllllooooooooooong" "g" ]
example2 = List.map list \string -> Str.concat string "!"
out =
when List.get example2 0 is
Ok s -> s
Err _ -> "Hello, World!\n"
"#
)
}