From 916d37b93c8ad0e2fbe98377093726baf051b708 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 5 Feb 2024 09:32:10 +0100 Subject: Ignore the global checkers if there is a syntax error; ignore error during recovery after a syntax error --- test/location.ml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/location.ml (limited to 'test/location.ml') 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; + ] ) -- cgit v1.2.3