From f7d278a472cbbbedabf9d80267d79ea5a814765a Mon Sep 17 00:00:00 2001 From: microproofs Date: Sun, 6 Aug 2023 18:54:01 -0400 Subject: [PATCH] fix: 2 acceptance tests were throwing errors due to exhaustiveness checker --- examples/acceptance_tests/040/lib/tests.ak | 29 +++++++--------------- examples/acceptance_tests/084/lib/tests.ak | 2 +- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/examples/acceptance_tests/040/lib/tests.ak b/examples/acceptance_tests/040/lib/tests.ak index f5a8a87d..8c871f09 100644 --- a/examples/acceptance_tests/040/lib/tests.ak +++ b/examples/acceptance_tests/040/lib/tests.ak @@ -28,8 +28,7 @@ test expect_ford1() { builtin.list_data([]), ], ) - expect Ford { owner, wheels, truck_bed_limit, .. }: Car = - initial_car + expect Ford { owner, wheels, truck_bed_limit, .. }: Car = initial_car owner == #"" && wheels == 4 && truck_bed_limit == 10000 } @@ -42,32 +41,28 @@ test expect_ford2() { truck_bed_limit: 15000, car_doors: [], } - expect Ford { owner, wheels, remote_connect, .. } = - initial_car + expect Ford { owner, wheels, remote_connect, .. } = initial_car owner == #"2222222222" && wheels == 6 && remote_connect == #"" } test expect_list1() { let initial_car = [5, 6, 7] - expect [a, b, c] = - initial_car + expect [a, b, c] = initial_car a == 5 && b == 6 && c == 7 } test expect_list2() { let initial_car = [5, 6, 7] - expect [a, ..d] = - initial_car + expect [a, ..d] = initial_car a == 5 && d == [6, 7] } test expect_list3() { let initial_car = builtin.list_data([builtin.i_data(5), builtin.i_data(6), builtin.i_data(7)]) - expect [a, ..d]: List = - initial_car + expect [a, ..d]: List = initial_car a == 5 && d == [6, 7] } @@ -76,22 +71,16 @@ type Redeemer { } test single_field_expect() { - let redeemer = - CreateVoteBatch { id: #"" } - expect CreateVoteBatch { id } = - redeemer + let redeemer = CreateVoteBatch { id: #"" } + expect CreateVoteBatch { id } = redeemer id == #"" } test single_when() { - let redeemer = - CreateVoteBatch { id: #"" } + let redeemer = CreateVoteBatch { id: #"" } let x = when redeemer is { - CreateVoteBatch { id } -> - id == #"" - _ -> - False + CreateVoteBatch { id } -> id == #"" } x == True } diff --git a/examples/acceptance_tests/084/lib/tests.ak b/examples/acceptance_tests/084/lib/tests.ak index e9db5434..f3986b14 100644 --- a/examples/acceptance_tests/084/lib/tests.ak +++ b/examples/acceptance_tests/084/lib/tests.ak @@ -16,10 +16,10 @@ test tuple_when() { when item is { (token_policy, _, token_amount) -> amount == token_amount && policy == token_policy - _ -> False } }, ) + list.length(filtered) > 0 }