mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Add gen-test for #4732
This commit is contained in:
parent
a8693e6102
commit
fbfc429bc5
1 changed files with 47 additions and 0 deletions
|
@ -3714,4 +3714,51 @@ mod pattern_match {
|
|||
RocList<u16>
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn order_list_size_tests_issue_4732() {
|
||||
assert_evals_to!(
|
||||
r#"
|
||||
helper : List U8 -> U8
|
||||
helper = \l -> when l is
|
||||
[1, ..] -> 1
|
||||
[2, 1, ..] -> 2
|
||||
[3, 2, 1, ..] -> 3
|
||||
[4, 3, 2, 1, ..] -> 4
|
||||
[4, 3, 2, ..] -> 5
|
||||
[4, 3, ..] -> 6
|
||||
[4, ..] -> 7
|
||||
_ -> 8
|
||||
|
||||
[
|
||||
helper [1], helper [1, 2],
|
||||
|
||||
helper [2, 1], helper [2, 1, 3],
|
||||
|
||||
helper [3, 2, 1], helper [3, 2, 1, 4],
|
||||
|
||||
helper [4, 3, 2, 1], helper [4, 3, 2, 1, 5],
|
||||
|
||||
helper [4, 3, 2], helper [4, 3, 2, 5],
|
||||
|
||||
helper [4, 3], helper [4, 3, 5],
|
||||
|
||||
helper [4], helper [4, 5],
|
||||
|
||||
helper [], helper [7],
|
||||
]
|
||||
"#,
|
||||
RocList::from_slice(&[
|
||||
1, 1, //
|
||||
2, 2, //
|
||||
3, 3, //
|
||||
4, 4, //
|
||||
5, 5, //
|
||||
6, 6, //
|
||||
7, 7, //
|
||||
8, 8, //
|
||||
]),
|
||||
RocList<u8>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue