From 2a15626c3c5cc78811a34b8e9e34856cf39051fa Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Sun, 10 Oct 2021 20:08:08 +0300 Subject: [PATCH] Change tests to include multiple guards --- test/aeso_compiler_tests.erl | 5 +++-- test/contracts/patterns_guards.aes | 10 +++++++--- test/contracts/stateful_pattern_guard.aes | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index 26804a1..934441d 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -810,8 +810,9 @@ failing_contracts() -> "Unbound variable g at line 8, column 23">> ]) , ?TYPE_ERROR(stateful_pattern_guard, - [<> + [<> + ]) ]) ]. diff --git a/test/contracts/patterns_guards.aes b/test/contracts/patterns_guards.aes index 6c6db60..081749b 100644 --- a/test/contracts/patterns_guards.aes +++ b/test/contracts/patterns_guards.aes @@ -6,10 +6,14 @@ contract C = entrypoint init() = f([1, 2, 3, 4]) function - f(x::[]) = 1 + f(x::[]) + | x > 1, x < 10 = 1 + | x < 1 = 9 f(x::y::[]) = 2 f(x::y::z) = switch(z) [] => 4 - a::[] | a > 10 => 5 + a::[] + | a > 10, a < 20 => 5 + | a > 5 => 8 b | List.length(b) > 5 => 6 - c => 7 \ No newline at end of file + c => 7 diff --git a/test/contracts/stateful_pattern_guard.aes b/test/contracts/stateful_pattern_guard.aes index e3706b4..a295ca1 100644 --- a/test/contracts/stateful_pattern_guard.aes +++ b/test/contracts/stateful_pattern_guard.aes @@ -1,5 +1,3 @@ -include "List.aes" - contract C = type state = int