diff options
author | Chimrod <> | 2024-02-05 09:32:10 +0100 |
---|---|---|
committer | Chimrod <> | 2024-02-08 14:16:41 +0100 |
commit | 916d37b93c8ad0e2fbe98377093726baf051b708 (patch) | |
tree | e8c6b77368fb8971af11a425ac61e0b3e2014beb /test/location.ml | |
parent | d7a13b0e5d6e746993e67a291376bd79766e0ed1 (diff) |
Ignore the global checkers if there is a syntax error; ignore error during recovery after a syntax error
Diffstat (limited to 'test/location.ml')
-rw-r--r-- | test/location.ml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/location.ml b/test/location.ml new file mode 100644 index 0000000..5072164 --- /dev/null +++ b/test/location.ml @@ -0,0 +1,28 @@ +module Check = Make_checkTest.M (Qsp_syntax.Locations) + +let _position = (Lexing.dummy_pos, Lexing.dummy_pos) + +let error_message = + [ + ( "Location", + Check. + { + level = Error; + loc = _position; + message = "The location unknown_place does not exists"; + } ); + ] + +let ok () = Check.global_check "gt 'location'" [] +let ok_upper () = Check.global_check "gt 'LOCATION'" [] +let missing_gt () = Check.global_check "gt 'unknown_place'" error_message +let missing_gs () = Check.global_check "gs 'unknown_place'" error_message + +let test = + ( "Locations", + [ + Alcotest.test_case "Ok" `Quick ok; + Alcotest.test_case "Ok upper" `Quick ok_upper; + Alcotest.test_case "Missing GT" `Quick missing_gt; + Alcotest.test_case "Missing GS" `Quick missing_gs; + ] ) |