mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Add gen test
This commit is contained in:
parent
247913dc20
commit
4936708b18
1 changed files with 35 additions and 0 deletions
|
@ -4386,3 +4386,38 @@ fn recursive_lambda_set_resolved_only_upon_specialization() {
|
|||
u64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn layout_cache_structure_with_multiple_recursive_structures() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
Chain : [
|
||||
End,
|
||||
Link Chain,
|
||||
]
|
||||
|
||||
LinkedList : [Nil, Cons { first : Chain, rest : LinkedList }]
|
||||
|
||||
main =
|
||||
base : LinkedList
|
||||
base = Nil
|
||||
|
||||
walker : LinkedList, Chain -> LinkedList
|
||||
walker = \rest, first -> Cons { first, rest }
|
||||
|
||||
list : List Chain
|
||||
list = []
|
||||
|
||||
r = List.walk list base walker
|
||||
|
||||
if r == base then 11u8 else 22u8
|
||||
"#
|
||||
),
|
||||
11,
|
||||
u8
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue