aboutsummaryrefslogtreecommitdiff
path: root/test/location.ml
blob: 50721641d253caf82f9e04f67ca262feb472a03f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
    ] )