Skip to content

Commit

Permalink
Add PPX expect tests for let%lwt structure items
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Oct 6, 2019
1 parent ca2e22d commit 1d44e3b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Empty file.
2 changes: 2 additions & 0 deletions test/ppx_expect/cases/run_1.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let%lwt () =
Lwt.return ()
2 changes: 2 additions & 0 deletions test/ppx_expect/cases/run_2.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
File "run_2.ml", line 1, characters 4-7:
Error: Uninterpreted extension 'lwt'.
2 changes: 2 additions & 0 deletions test/ppx_expect/cases/run_2.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let%lwt rec () = Lwt.return ()
and () = Lwt.return ()
10 changes: 3 additions & 7 deletions test/ppx_expect/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,11 @@ let run_test name =
let fixed_name = name ^ ".fixed" in
let command =
Printf.sprintf
"%s %s ocamlfind c %s -linkpkg -package lwt,lwt_ppx %s > %s 2>&1"
"%s %s ocamlfind c %s -linkpkg -thread -package %s %s > %s 2>&1"
("OCAMLPATH=" ^ package_directory) "OCAML_ERROR_STYLE=short"
"-color=never" ml_name fixed_name
"-color=never" "lwt.unix,lwt_ppx" ml_name fixed_name
in
let ocaml_return_code = _run_int command in
begin if ocaml_return_code = 0 then
failwith
(Printf.sprintf "Unexpected compiler return code: %d" ocaml_return_code)
end;
ignore (_run_int command);
diff expect_name fixed_name

let () =
Expand Down

0 comments on commit 1d44e3b

Please sign in to comment.