add tests for List.dropAt

This commit is contained in:
Dan Knutson 2021-10-02 21:44:35 -05:00
parent 3baff93a97
commit 700ab20a8c
3 changed files with 29 additions and 8 deletions

View file

@ -198,6 +198,21 @@ fn list_drop() {
assert_evals_to!("List.drop [1,2] 5", RocList::from_slice(&[]), RocList<i64>);
}
#[test]
fn list_drop_at() {
assert_evals_to!(
"List.dropAt [1, 2, 3] 0",
RocList::from_slice(&[2, 3]),
RocList<i64>
);
assert_evals_to!(
"List.dropAt [0, 0, 0] 3",
RocList::from_slice(&[1, 2, 3]),
RocList<i64>
);
assert_evals_to!("List.dropAt [] 1", RocList::from_slice(&[]), RocList<i64>);
}
#[test]
fn list_swap() {
assert_evals_to!("List.swap [] 0 1", RocList::from_slice(&[]), RocList<i64>);