add tests
This commit is contained in:
parent
7e05b7d276
commit
8ce4772ae4
@ -943,4 +943,12 @@ let%expect_test _ =
|
||||
|
||||
let%expect_test _ =
|
||||
run_ligo_bad [ "compile-contract" ; contract "bad_timestamp.ligo" ; "main" ] ;
|
||||
[%expect {| ligo: in file "bad_timestamp.ligo", line 5, characters 29-43. Badly formatted timestamp "badtimestamp": {"location":"in file \"bad_timestamp.ligo\", line 5, characters 29-43"} |}]
|
||||
[%expect {| ligo: in file "bad_timestamp.ligo", line 5, characters 29-43. Badly formatted timestamp "badtimestamp": {"location":"in file \"bad_timestamp.ligo\", line 5, characters 29-43"} |}]
|
||||
|
||||
let%expect_test _ =
|
||||
run_ligo_good [ "dry-run" ; contract "redeclaration.ligo" ; "main" ; "unit" ; "0" ] ;
|
||||
[%expect {|( [] , 0 ) |}]
|
||||
|
||||
let%expect_test _ =
|
||||
run_ligo_good [ "dry-run" ; contract "double_main.ligo" ; "main" ; "unit" ; "0" ] ;
|
||||
[%expect {|( [] , 2 ) |}]
|
8
src/test/contracts/double_main.ligo
Normal file
8
src/test/contracts/double_main.ligo
Normal file
@ -0,0 +1,8 @@
|
||||
function main(const p : unit; const s : int) : list(operation) * int is
|
||||
((list end : list(operation)), s + 1)
|
||||
|
||||
function main(const p : unit; const s : int) : list(operation) * int is
|
||||
begin
|
||||
const ret : list(operation) * int = main(p, s)
|
||||
end
|
||||
with (ret.0, ret.1 + 1)
|
6
src/test/contracts/redeclaration.ligo
Normal file
6
src/test/contracts/redeclaration.ligo
Normal file
@ -0,0 +1,6 @@
|
||||
function foo(const p : unit) : int is 0
|
||||
|
||||
function main(const p : unit; const s : int) : list(operation) * int is
|
||||
((list end : list(operation)), foo(unit))
|
||||
|
||||
function foo(const p : unit) : int is 1
|
Loading…
Reference in New Issue
Block a user