diff --git a/src/bin/expect_tests/typer_error_tests.ml b/src/bin/expect_tests/typer_error_tests.ml index 4aa7b95e8..32eb559d7 100644 --- a/src/bin/expect_tests/typer_error_tests.ml +++ b/src/bin/expect_tests/typer_error_tests.ml @@ -1,6 +1,19 @@ open Cli_expect let%expect_test _ = + run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_function_annotation.mligo"; "main"]; + [%expect {| + ligo: in file "", line 0, characters 0-0. different type constructors: Expected these two constant type constructors to be the same, but they're different {"a":"unit","b":"int"} + + + 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' |}]; + run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_type.ligo" ; "main" ] ; [%expect {| ligo: in file "error_type.ligo", line 3, characters 18-28. Adding modulo with wrong types: Expected arguments with one of the following combinations of types: add(nat , nat) or add(int , int) or add(mutez , mutez) or add(nat , int) or add(int , nat) or add(timestamp , int) or add(int , timestamp) but got this combination instead: add(int , string) @@ -135,4 +148,4 @@ let%expect_test _ = * 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' |}]; \ No newline at end of file + * Check the changelog by running 'ligo changelog' |}]; diff --git a/src/test/contracts/negative/error_function_annotation.mligo b/src/test/contracts/negative/error_function_annotation.mligo new file mode 100644 index 000000000..3360a7b1a --- /dev/null +++ b/src/test/contracts/negative/error_function_annotation.mligo @@ -0,0 +1 @@ +let main (a:int) : unit = a