add tests for sum type names limit length
This commit is contained in:
parent
5a15feadc1
commit
503d8f771e
@ -1139,6 +1139,19 @@ let%expect_test _ =
|
|||||||
storage (pair (map %one key_hash nat) (big_map %two key_hash bool)) ;
|
storage (pair (map %one key_hash nat) (big_map %two key_hash bool)) ;
|
||||||
code { DUP ; CDR ; NIL operation ; PAIR ; DIP { DROP } } } |}]
|
code { DUP ; CDR ; NIL operation ; PAIR ; DIP { DROP } } } |}]
|
||||||
|
|
||||||
|
let%expect_test _ =
|
||||||
|
run_ligo_bad [ "compile-contract" ; bad_contract "long_sum_type_names.ligo" ; "main" ] ;
|
||||||
|
[%expect {|
|
||||||
|
ligo: Too long constructor 'Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt': names length is limited to 32 (tezos limitation)
|
||||||
|
|
||||||
|
If you're not sure how to fix this error, you can
|
||||||
|
do one of the following:
|
||||||
|
|
||||||
|
* Visit our documentation: https://ligolang.org/docs/intro/what-and-why/
|
||||||
|
* Ask a question on our Discord: https://discord.gg/9rhYaEt
|
||||||
|
* Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new
|
||||||
|
* Check the changelog by running 'ligo changelog' |}]
|
||||||
|
|
||||||
let%expect_test _ =
|
let%expect_test _ =
|
||||||
run_ligo_good [ "dry-run" ; contract "super-counter.mligo" ; "main" ; "test_param" ; "test_storage" ] ;
|
run_ligo_good [ "dry-run" ; contract "super-counter.mligo" ; "main" ; "test_param" ; "test_storage" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
|
18
src/test/contracts/negative/long_sum_type_names.ligo
Normal file
18
src/test/contracts/negative/long_sum_type_names.ligo
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
type action is
|
||||||
|
| Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt of int
|
||||||
|
// | Increment of int
|
||||||
|
| Decrement of int
|
||||||
|
|
||||||
|
function add (const a : int ; const b : int) : int is a + b
|
||||||
|
|
||||||
|
function subtract (const a : int ; const b : int) : int is a - b
|
||||||
|
|
||||||
|
function main (const p : action ; const s : int) : (list(operation) * int) is
|
||||||
|
((nil : list(operation)),
|
||||||
|
case p of
|
||||||
|
| Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt (n) -> add (s, n)
|
||||||
|
// | Increment(n) -> add (s, n)
|
||||||
|
| Decrement (n) -> subtract (s, n)
|
||||||
|
end)
|
||||||
|
|
||||||
|
// incrementttttttttttttttttttttttt
|
Loading…
Reference in New Issue
Block a user