diff options
author | Chimrod <> | 2023-10-28 13:52:38 +0200 |
---|---|---|
committer | Chimrod <> | 2023-11-02 11:06:12 +0100 |
commit | 872916a5661e31b655471ec0f9bf81a5474bc1ba (patch) | |
tree | db18486f978ec97b8ddb4d4ce4e810ccd5cbf7e7 /test/dead_end.ml | |
parent | 8a7bdc73a7c65d23c79e1c470ba0fbff975b59a5 (diff) |
Updated the tests
Diffstat (limited to 'test/dead_end.ml')
-rw-r--r-- | test/dead_end.ml | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/test/dead_end.ml b/test/dead_end.ml index 9cce62d..f91680f 100644 --- a/test/dead_end.ml +++ b/test/dead_end.ml @@ -1,48 +1,9 @@ -module Dead_end = Qsp_syntax.Dead_end -module S = Qsp_syntax.S +module Check = Make_checkTest.M (Qsp_syntax.Dead_end) let _position = (Lexing.dummy_pos, Lexing.dummy_pos) -let pp_pos = Qsp_syntax.Report.pp_pos - -type pos = S.pos - -let equal_pos : pos -> pos -> bool = fun _ _ -> true - -type t = Qsp_syntax.Report.t = { - level : Qsp_syntax.Report.level; - loc : pos; - message : string; -} -[@@deriving show, eq] - -let report : Qsp_syntax.Report.t list Alcotest.testable = - Alcotest.list @@ Alcotest.testable Qsp_syntax.Report.pp equal - -let parse : - string -> - (Dead_end.Location.t * Qsp_syntax.Report.t list, Qsp_syntax.Report.t) result - = - fun content -> - let lexing = - Sedlexing.Latin1.from_string content |> Qparser.Lexbuf.from_lexbuf - in - Qparser.Analyzer.parse (module Dead_end) lexing - -let get_report : - (Dead_end.Location.t * Qsp_syntax.Report.t list, Qsp_syntax.Report.t) result -> - Qsp_syntax.Report.t list = function - | Ok (_, report) -> report - | Error _ -> failwith "Error" let _test_instruction : string -> Qsp_syntax.Report.t list -> unit = - fun literal expected -> - let _location = Printf.sprintf {|# Location -%s -------- |} literal in - let actual = get_report @@ parse _location and msg = literal in - - Alcotest.(check' report ~msg ~expected ~actual) - + Check._test_instruction (** This one is OK because act provide a solution in any case *) let ok () = _test_instruction {| |