mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
add dropFirst builtin
This commit is contained in:
parent
0fdd8ac1b4
commit
f3a350dd74
4 changed files with 44 additions and 0 deletions
|
@ -267,6 +267,17 @@ fn list_drop_last_mutable() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_drop_first() {
|
||||
assert_evals_to!(
|
||||
"List.dropFirst [1, 2, 3]",
|
||||
RocList::from_slice(&[2, 3]),
|
||||
RocList<i64>
|
||||
);
|
||||
assert_evals_to!("List.dropFirst []", RocList::from_slice(&[]), RocList<i64>);
|
||||
assert_evals_to!("List.dropFirst [0]", RocList::from_slice(&[]), RocList<i64>);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_swap() {
|
||||
assert_evals_to!("List.swap [] 0 1", RocList::from_slice(&[]), RocList<i64>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue