mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Merge branch 'trunk' into builtins-list-intersperse
This commit is contained in:
commit
ce8a88416d
319 changed files with 4413 additions and 3654 deletions
|
@ -248,6 +248,47 @@ fn list_sublist() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn list_split() {
|
||||
assert_evals_to!(
|
||||
r#"
|
||||
list = List.split [1, 2, 3] 0
|
||||
list.before
|
||||
"#,
|
||||
RocList::from_slice(&[]),
|
||||
RocList<i64>
|
||||
);
|
||||
assert_evals_to!(
|
||||
r#"
|
||||
list = List.split [1, 2, 3] 0
|
||||
list.others
|
||||
"#,
|
||||
RocList::from_slice(&[1, 2, 3]),
|
||||
RocList<i64>
|
||||
);
|
||||
|
||||
assert_evals_to!(
|
||||
"List.split [1, 2, 3] 1",
|
||||
(RocList::from_slice(&[1]), RocList::from_slice(&[2, 3]),),
|
||||
(RocList<i64>, RocList<i64>,)
|
||||
);
|
||||
assert_evals_to!(
|
||||
"List.split [1, 2, 3] 3",
|
||||
(RocList::from_slice(&[1, 2, 3]), RocList::from_slice(&[]),),
|
||||
(RocList<i64>, RocList<i64>,)
|
||||
);
|
||||
assert_evals_to!(
|
||||
"List.split [1, 2, 3] 4",
|
||||
(RocList::from_slice(&[1, 2, 3]), RocList::from_slice(&[]),),
|
||||
(RocList<i64>, RocList<i64>,)
|
||||
);
|
||||
assert_evals_to!(
|
||||
"List.split [] 1",
|
||||
(RocList::from_slice(&[]), RocList::from_slice(&[]),),
|
||||
(RocList<i64>, RocList<i64>,)
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn list_drop() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue