location.ml 816 B

12345678910111213141516171819202122232425262728
  1. module Check = Make_checkTest.M (Qsp_syntax.Locations)
  2. let _position = (Lexing.dummy_pos, Lexing.dummy_pos)
  3. let error_message =
  4. [
  5. ( "Location",
  6. Check.
  7. {
  8. level = Error;
  9. loc = _position;
  10. message = "The location unknown_place does not exists";
  11. } );
  12. ]
  13. let ok () = Check.global_check "gt 'location'" []
  14. let ok_upper () = Check.global_check "gt 'LOCATION'" []
  15. let missing_gt () = Check.global_check "gt 'unknown_place'" error_message
  16. let missing_gs () = Check.global_check "gs 'unknown_place'" error_message
  17. let test =
  18. ( "Locations",
  19. [
  20. Alcotest.test_case "Ok" `Quick ok;
  21. Alcotest.test_case "Ok upper" `Quick ok_upper;
  22. Alcotest.test_case "Missing GT" `Quick missing_gt;
  23. Alcotest.test_case "Missing GS" `Quick missing_gs;
  24. ] )