mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Order list-min-size tests in descending order
Some of the head-constructor tests we generate can be supersets of other tests. Edges must be ordered so that more general tests always happen after their specialized variants. For example, patterns [1, ..] -> ... [2, 1, ..] -> ... may generate the edges ListLen(>=1) -> <rest> ListLen(>=2) -> <rest> but evaluated in exactly this order, the second edge is never reachable. The necessary ordering is ListLen(>=2) -> <rest> ListLen(>=1) -> <rest> Closes #4732
This commit is contained in:
parent
a295e7ac3d
commit
a8693e6102
3 changed files with 324 additions and 31 deletions
|
@ -2220,3 +2220,17 @@ fn lambda_set_with_imported_toplevels_issue_4733() {
|
|||
"###
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn order_list_size_tests_issue_4732() {
|
||||
indoc!(
|
||||
r###"
|
||||
when [] is
|
||||
[1, ..] -> "B1"
|
||||
[2, 1, ..] -> "B2"
|
||||
[3, 2, 1, ..] -> "B3"
|
||||
[4, 3, 2, 1, ..] -> "B4"
|
||||
_ -> "Catchall"
|
||||
"###
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue