Move the last two negative tests to a subdirectory, actually check that they fail in the expected way
This commit is contained in:
parent
8f2ff058ec
commit
75e6344972
7
src/bin/expect_tests/syntax_error_tests.ml
Normal file
7
src/bin/expect_tests/syntax_error_tests.ml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
open Cli_expect
|
||||||
|
|
||||||
|
let%expect_test _ =
|
||||||
|
run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_syntax.ligo" ; "main" ] ;
|
||||||
|
[%expect {|
|
||||||
|
ligo: parser error: Parse error at "-" from (1, 16) to (1, 17). In file "|../../test/contracts/negative/error_syntax.ligo"
|
||||||
|
{"parser_loc":"in file \"\", line 1, characters 16-17"} |} ] ;
|
@ -1,6 +1,9 @@
|
|||||||
open Cli_expect
|
open Cli_expect
|
||||||
|
|
||||||
let%expect_test _ =
|
let%expect_test _ =
|
||||||
|
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 with wrong types. Expected nat, int or tez. |} ] ;
|
||||||
|
|
||||||
run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_typer_1.mligo" ; "main" ] ;
|
run_ligo_bad [ "compile-contract" ; "../../test/contracts/negative/error_typer_1.mligo" ; "main" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
ligo: in file "error_typer_1.mligo", line 3, characters 19-27. different type constructors: Expected these two constant type constructors to be the same, but they're different {"a":"string","b":"int"}
|
ligo: in file "error_typer_1.mligo", line 3, characters 19-27. different type constructors: Expected these two constant type constructors to be the same, but they're different {"a":"string","b":"int"}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
(ocamllex md)
|
(ocamllex md)
|
||||||
|
|
||||||
(executables
|
(executables
|
||||||
(names test manual_test doc_test)
|
(names test doc_test)
|
||||||
(libraries
|
(libraries
|
||||||
simple-utils
|
simple-utils
|
||||||
ligo
|
ligo
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
open Trace
|
|
||||||
open Ligo.Run
|
|
||||||
open Test_helpers
|
|
||||||
|
|
||||||
let syntax_error () : unit result =
|
|
||||||
let%bind _program = type_file `pascaligo "./contracts/error_syntax.ligo" in
|
|
||||||
ok ()
|
|
||||||
|
|
||||||
let type_error () : unit result =
|
|
||||||
let%bind _program = type_file `pascaligo "./contracts/error_type.ligo" in
|
|
||||||
ok ()
|
|
||||||
|
|
||||||
let () =
|
|
||||||
List.iter wrap_test_raw [
|
|
||||||
type_error ;
|
|
||||||
syntax_error ;
|
|
||||||
]
|
|
Loading…
Reference in New Issue
Block a user