From 4217fd06b57ebf3eb32991b3eae5aa9b0f8cfa10 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Tue, 13 Dec 2022 14:40:05 +0100 Subject: [PATCH] Add new acceptance test scenario (009) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: the problem is only present when importing a builtin explicitly. When using a qualified import, it compiles fine. ``` Error: × Main thread panicked. ├─▶ at crates/lang/src/uplc.rs:3264:35 ╰─▶ called `Option::unwrap()` on a `None` value help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. ``` --- examples/acceptance_tests/009/aiken.toml | 2 ++ examples/acceptance_tests/009/lib/test.ak | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 examples/acceptance_tests/009/aiken.toml create mode 100644 examples/acceptance_tests/009/lib/test.ak diff --git a/examples/acceptance_tests/009/aiken.toml b/examples/acceptance_tests/009/aiken.toml new file mode 100644 index 00000000..575d56fb --- /dev/null +++ b/examples/acceptance_tests/009/aiken.toml @@ -0,0 +1,2 @@ +name = "acceptance_test_009" +version = "0.0.0" diff --git a/examples/acceptance_tests/009/lib/test.ak b/examples/acceptance_tests/009/lib/test.ak new file mode 100644 index 00000000..b4ef2b0d --- /dev/null +++ b/examples/acceptance_tests/009/lib/test.ak @@ -0,0 +1,9 @@ +use aiken/builtin.{length_of_bytearray} + +pub fn is_empty(bytes: ByteArray) -> Bool { + length_of_bytearray(bytes) == 0 +} + +test is_empty_1() { + is_empty(#[]) == True +}