Add new acceptance test scenario: 066

Mutua recursion.
This commit is contained in:
KtorZ 2023-02-17 17:10:48 +01:00 committed by Kasey
parent 74b8ab62b2
commit 984237075a
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# This file was generated by Aiken
# You typically do not need to edit this file
requirements = []
packages = []

View File

@ -0,0 +1,3 @@
name = 'aiken-lang/acceptance_test_066'
version = '0.0.0'
description = ''

View File

@ -0,0 +1,25 @@
type Schema {
Integer(Int)
List(List<Schema>)
}
fn sum(schema: Schema) -> Int {
when schema is {
Integer(i) -> i
List(xs) -> sum_list(xs)
}
}
fn sum_list(list: List<Schema>) -> Int {
when list is {
[] -> 0
[x, ..xs] -> sum(x) + sum_list(xs)
}
}
test foo() {
False
// Can't enable the "real" test because it puts the UPLC evaluator in an infinite loop.
// -
// sum(List([List([Integer(1), Integer(2)]), Integer(3), Integer(4)])) == 10
}