diff --git a/examples/acceptance_tests/066/aiken.lock b/examples/acceptance_tests/066/aiken.lock new file mode 100644 index 00000000..3a78b1e7 --- /dev/null +++ b/examples/acceptance_tests/066/aiken.lock @@ -0,0 +1,5 @@ +# This file was generated by Aiken +# You typically do not need to edit this file + +requirements = [] +packages = [] diff --git a/examples/acceptance_tests/066/aiken.toml b/examples/acceptance_tests/066/aiken.toml new file mode 100644 index 00000000..8b409cd8 --- /dev/null +++ b/examples/acceptance_tests/066/aiken.toml @@ -0,0 +1,3 @@ +name = 'aiken-lang/acceptance_test_066' +version = '0.0.0' +description = '' diff --git a/examples/acceptance_tests/066/lib/tests.ak b/examples/acceptance_tests/066/lib/tests.ak new file mode 100644 index 00000000..a4981ef3 --- /dev/null +++ b/examples/acceptance_tests/066/lib/tests.ak @@ -0,0 +1,25 @@ +type Schema { + Integer(Int) + List(List) +} + +fn sum(schema: Schema) -> Int { + when schema is { + Integer(i) -> i + List(xs) -> sum_list(xs) + } +} + +fn sum_list(list: List) -> 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 +}