aboutsummaryrefslogtreecommitdiff
path: root/test/make_checkTest.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/make_checkTest.ml')
-rw-r--r--test/make_checkTest.ml24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/make_checkTest.ml b/test/make_checkTest.ml
index d3ad358..a863214 100644
--- a/test/make_checkTest.ml
+++ b/test/make_checkTest.ml
@@ -23,42 +23,42 @@ module M (Check : Qsp_syntax.S.Analyzer) = struct
@@ Alcotest.pair Alcotest.string
(Alcotest.testable Qsp_syntax.Report.pp equal)
- let parse :
+ let _parse :
?context:Check.context ->
+ Qparser.Analyzer.lexer ->
string ->
(Check.Location.t Qparser.Analyzer.result, t) result =
- fun ?context content ->
+ fun ?context lexer content ->
let lexing =
Sedlexing.Latin1.from_string content |> Qparser.Lexbuf.from_lexbuf
in
let context = Option.value context ~default:(Check.initialize ()) in
- Qparser.Analyzer.parse (module Check) lexing context
+ Qparser.Analyzer.parse (module Check) lexer lexing context
let get_report :
(Check.Location.t Qparser.Analyzer.result, Qsp_syntax.Report.t) result ->
Qsp_syntax.Report.t list = function
| Ok v -> v.report
- | Error _ -> failwith "Error"
+ | Error msg -> failwith msg.message
let _test_instruction : string -> t list -> unit =
fun literal expected ->
- let _location = Printf.sprintf {|# Location
-%s
-------- |} literal in
- let actual = get_report @@ parse _location and msg = literal in
+ let actual = get_report @@ _parse Qparser.Analyzer.Dynamic literal
+ and msg = literal in
Alcotest.(check' report ~msg ~expected ~actual)
- (** Run a test over the whole file.
- The parsing of the content shall not report any error.
- *)
+ (** Run a test over the whole file. The parsing of the content shall not
+ report any error. *)
let global_check : string -> (string * t) list -> unit =
fun literal expected ->
let _location = Printf.sprintf {|# Location
%s
------- |} literal in
let context = Check.initialize () in
- let actual = get_report @@ parse ~context _location in
+ let actual =
+ get_report @@ _parse ~context Qparser.Analyzer.Location _location
+ in
let () =
Alcotest.(
check' report ~msg:"Error reported during parsing" ~expected:[] ~actual)