From c50bf94020cb3b535e44be5af60df260d1bce2bf Mon Sep 17 00:00:00 2001 From: KtorZ Date: Tue, 7 Feb 2023 16:42:10 +0100 Subject: [PATCH] Add new acceptance test scenario: 053 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` × foo failed help: ┍━ left ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ │ Failed to deserialise PlutusData using UnConstrData: │ │ │ │ Con( │ │ Data( │ │ BigInt( │ │ Int( │ │ Int( │ │ Int { │ │ neg: false, │ │ val: 0, │ │ }, │ │ ), │ │ ), │ │ ), │ │ ), │ │ ) │ ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙ should be equal to ┍━ right ━━━━━━━━━┑ │ (con integer 3) │ ┕━━━━━━━━━━━━━━━━━┙ ``` --- examples/acceptance_tests/053/aiken.lock | 5 +++++ examples/acceptance_tests/053/aiken.toml | 3 +++ examples/acceptance_tests/053/lib/tests.ak | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 examples/acceptance_tests/053/aiken.lock create mode 100644 examples/acceptance_tests/053/aiken.toml create mode 100644 examples/acceptance_tests/053/lib/tests.ak 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 +}