From b15e6c296b703eaae65c7fa7ed8e65971b49212c Mon Sep 17 00:00:00 2001 From: microproofs Date: Wed, 24 Jan 2024 16:21:06 -0500 Subject: [PATCH] Add a few more expect cases to test 40 --- examples/acceptance_tests/040/lib/tests.ak | 59 +++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/examples/acceptance_tests/040/lib/tests.ak b/examples/acceptance_tests/040/lib/tests.ak index 8c871f09..c2067068 100644 --- a/examples/acceptance_tests/040/lib/tests.ak +++ b/examples/acceptance_tests/040/lib/tests.ak @@ -66,13 +66,68 @@ test expect_list3() { a == 5 && d == [6, 7] } +test expect_list4() { + let initial_car = + [4, 5, 6, 7] + expect [a, b, ..] = initial_car + a == 4 && b == 5 +} + +test expect_list5() { + let initial_car: Data = + [4, 6, 6] + expect [a, b, ..]: List = initial_car + a == 4 && b == 6 +} + +test expect_list6() { + let initial_car = + [4, 6] + expect [a, b, ..] = initial_car + a == 4 && b == 6 +} + +test expect_list7() { + let initial_car: Data = + [4, 6] + expect [a, b, ..]: List = initial_car + a == 4 && b == 6 +} + +test expect_list8() fail { + let initial_car = + [4, 6] + expect [a] = initial_car + a == 4 +} + +test expect_list9() fail { + let initial_car: Data = + [4, 6, 7] + expect [a]: List = initial_car + a == 4 +} + +test expect_list10() { + let initial_car: Data = + [4] + expect [a]: List = initial_car + a == 4 +} + type Redeemer { CreateVoteBatch { id: ByteArray } } -test single_field_expect() { +test single_field_let() { let redeemer = CreateVoteBatch { id: #"" } - expect CreateVoteBatch { id } = redeemer + let CreateVoteBatch { id } = redeemer + id == #"" +} + +test single_field_expect() { + let redeemer: Data = CreateVoteBatch { id: #"" } + expect CreateVoteBatch { id }: Redeemer = redeemer id == #"" }