Skip to content

Commit

Permalink
test: Move to PpxLib.standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Oct 13, 2020
1 parent 285de0e commit ff5844d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
18 changes: 1 addition & 17 deletions bin/Bin.re
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
let argv =
switch (Sys.argv |> Array.to_list) {
| [program, ...rest] =>
switch (List.rev(rest)) {
| [output_file, input_file, ...args] =>
List.concat([
[program],
List.rev(args),
[input_file, "-o", output_file, "--dump-ast"],
])
|> Array.of_list
| _ => Sys.argv
}
| _ => Sys.argv
};

let () = Migrate_parsetree.Driver.run_main(~argv, ());
let () = Ppxlib.Driver.standalone();
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"build": "esy dune build -p ReactRulesOfHooksPpx",
"watch": "esy dune build -p ReactRulesOfHooksPpx --watch",
"test": "esy dune runtest",
"promote": "esy dune promote",
"doc": "esy dune build @doc",
"doc-path": "esy echo #{self.target_dir}/default/_doc/_html/index.html",
"format": "esy dune build @fmt --auto-promote",
Expand Down
6 changes: 3 additions & 3 deletions test/ExhaustiveDepsUseEffect.expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File "ExhaustiveDepsUseEffect.ml", line 3, characters 2-63:
File "ExhaustiveDepsUseEffect.ml", line 3, characters 2-63:
3 | React.useEffect1 (fun () -> Js.log randomProp; None) [|show|];
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: ExhaustiveDeps: Missing 'randomProp' in the dependency array
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: ExhaustiveDeps: Missing 'randomProp' in the dependency array
22 changes: 13 additions & 9 deletions test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; expect the process to fail, capturing stderr
(with-stderr-to
%{targets}
(bash "! ./%{pp} -o %{input}")
(bash "! ./%{pp} %{input}")
)
)
)
Expand All @@ -33,10 +33,12 @@
(:input ConditionalHooks.ml)
)
(action
; expect the process to fail, capturing stderr
(with-stderr-to
%{targets}
(bash "! ./%{pp} -o %{input}")
(progn
; expect the process to fail, capturing stderr
(with-stderr-to
%{targets}
(bash "! ./%{pp} %{input}")
)
)
)
)
Expand All @@ -45,9 +47,11 @@
(targets ConditionalHooks.ml)
(deps ConditionalHooks.re)
(action
(with-stdout-to
%{targets}
(run refmt --parse=re --print=ml %{deps})
(progn
(with-stdout-to
%{targets}
(run refmt --parse=re --print=ml %{deps})
)
)
)
)
Expand All @@ -57,7 +61,7 @@
(alias runtest)
(action
(progn
; (diff ExhaustiveDepsUseEffect.expected ExhaustiveDepsUseEffect.actual)
(diff ExhaustiveDepsUseEffect.expected ExhaustiveDepsUseEffect.actual)
(diff ConditionalHooks.expected ConditionalHooks.actual)
)
)
Expand Down

0 comments on commit ff5844d

Please sign in to comment.