diff --git a/examples/acceptance_tests/053/aiken.lock b/examples/acceptance_tests/053/aiken.lock new file mode 100644 index 00000000..3a78b1e7 --- /dev/null +++ b/examples/acceptance_tests/053/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/053/aiken.toml b/examples/acceptance_tests/053/aiken.toml new file mode 100644 index 00000000..e219f43a --- /dev/null +++ b/examples/acceptance_tests/053/aiken.toml @@ -0,0 +1,3 @@ +name = 'aiken-lang/acceptance_test_053' +version = '0.0.0' +description = '' diff --git a/examples/acceptance_tests/053/lib/tests.ak b/examples/acceptance_tests/053/lib/tests.ak new file mode 100644 index 00000000..e4f25625 --- /dev/null +++ b/examples/acceptance_tests/053/lib/tests.ak @@ -0,0 +1,16 @@ +pub type LinkedList { + Empty + Node(a, LinkedList) +} + +pub fn size(t: LinkedList) -> Int { + when t is { + Empty -> 0 + Node(_, tail) -> 1 + size(tail) + } +} + +test foo() { + let xs = Node(0, Node(1, Node(2, Empty))) + size(xs) == 3 +}