mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Merge branch 'trunk' into str_trim
This commit is contained in:
commit
29bd4e3e50
14 changed files with 1169 additions and 622 deletions
|
@ -235,6 +235,38 @@ fn list_drop_at_shared() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_drop_last() {
|
||||
assert_evals_to!(
|
||||
"List.dropLast [1, 2, 3]",
|
||||
RocList::from_slice(&[1, 2]),
|
||||
RocList<i64>
|
||||
);
|
||||
assert_evals_to!("List.dropLast []", RocList::from_slice(&[]), RocList<i64>);
|
||||
assert_evals_to!("List.dropLast [0]", RocList::from_slice(&[]), RocList<i64>);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_drop_last_mutable() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
list : List I64
|
||||
list = [ if True then 4 else 4, 5, 6 ]
|
||||
|
||||
{ newList: List.dropLast list, original: list }
|
||||
"#
|
||||
),
|
||||
(
|
||||
// new_list
|
||||
RocList::from_slice(&[4, 5]),
|
||||
// original
|
||||
RocList::from_slice(&[4, 5, 6]),
|
||||
),
|
||||
(RocList<i64>, 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