mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
feat(List): add map3
This commit is contained in:
parent
c2525d2407
commit
268ab82410
10 changed files with 351 additions and 2 deletions
|
@ -568,6 +568,36 @@ fn list_map_closure() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_map3_group() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
List.map3 [1,2,3] [3,2,1] [2,1,3] (\a, b, c -> Group a b c)
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[(1, 3, 2), (2, 2, 1), (3, 1, 3)]),
|
||||
RocList<(i64, i64, i64)>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_map3_different_length() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
List.map3
|
||||
["a", "b", "d" ]
|
||||
["b"],
|
||||
["c"],
|
||||
Str.concat
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[RocStr::from_slice("abc".as_bytes()),]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_map2_pair() {
|
||||
assert_evals_to!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue