mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
parent
44a2cd9468
commit
0d2ed76334
4 changed files with 125 additions and 0 deletions
|
@ -2221,3 +2221,35 @@ fn empty_list_of_function_type() {
|
|||
RocStr
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_join_map() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
List.joinMap ["guava,apple,pear", "bailey,cyrus"] (\s -> Str.split s ",")
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[
|
||||
RocStr::from_slice("guava".as_bytes()),
|
||||
RocStr::from_slice("apple".as_bytes()),
|
||||
RocStr::from_slice("pear".as_bytes()),
|
||||
RocStr::from_slice("bailey".as_bytes()),
|
||||
RocStr::from_slice("cyrus".as_bytes()),
|
||||
]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_join_map_empty() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
List.joinMap [] (\s -> Str.split s ",")
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue