sophia/test/contracts/assign_patterns.aes
Gaith Hallak 9540c7d200 Add tests
2021-09-07 17:52:47 +03:00

17 lines
354 B
Plaintext

include "List.aes"
contract AssignPatterns =
entrypoint test() = foo([1, 0, 2], (2, Some(3)), Some([4, 5]))
entrypoint foo(xs : list(int), p : int * option(int), some : option(list(int))) =
let x::(t = y::_) = xs
let z::_ = t
let (a, (o = Some(b))) = p
let Some((f = g::_)) = some
g + List.get(1, f)
x + y + z + a + b