Add new acceptance test scenario: 066
Mutua recursion.
This commit is contained in:
25
examples/acceptance_tests/066/lib/tests.ak
Normal file
25
examples/acceptance_tests/066/lib/tests.ak
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user