Change tests to include multiple guards

This commit is contained in:
Gaith Hallak 2021-10-10 20:08:08 +03:00
parent 06118542f2
commit 2a15626c3c
3 changed files with 10 additions and 7 deletions

View File

@ -810,8 +810,9 @@ failing_contracts() ->
"Unbound variable g at line 8, column 23">>
])
, ?TYPE_ERROR(stateful_pattern_guard,
[<<?Pos(10,12)
"Cannot reference stateful function g (at line 10, column 12) in a pattern guard.">>
[<<?Pos(8,12)
"Cannot reference stateful function g (at line 8, column 12) in a pattern guard.">>
])
])
].

View File

@ -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

View File

@ -1,5 +1,3 @@
include "List.aes"
contract C =
type state = int