Test closures more
This commit is contained in:
parent
31a2a96810
commit
7afa8a9cdb
6
src/contracts/closure-3.ligo
Normal file
6
src/contracts/closure-3.ligo
Normal file
@ -0,0 +1,6 @@
|
||||
function foobar(const i : int) : int is
|
||||
const j : int = 3 ;
|
||||
const k : int = 4 ;
|
||||
function toto(const l : int) : int is
|
||||
block { skip } with i + j + k + l;
|
||||
block { skip } with toto(42)
|
@ -69,6 +69,11 @@ let closure () : unit result =
|
||||
let%bind program = type_file "./contracts/closure.ligo" in
|
||||
let%bind program_1 = type_file "./contracts/closure-1.ligo" in
|
||||
let%bind program_2 = type_file "./contracts/closure-2.ligo" in
|
||||
let%bind program_3 = type_file "./contracts/closure-3.ligo" in
|
||||
let%bind _ =
|
||||
let make_expect = fun n -> (49 + n) in
|
||||
expect_eq_n_int program_3 "foobar" make_expect
|
||||
in
|
||||
let%bind _ =
|
||||
let make_expect = fun n -> (45 + n) in
|
||||
expect_eq_n_int program_2 "foobar" make_expect
|
||||
|
Loading…
Reference in New Issue
Block a user