Skip to content

Commit

Permalink
Sys.ignore_commandf
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols committed May 10, 2023
1 parent 34b7117 commit 92b9a05
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/golden/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let spf = Format.sprintf
module Sys = struct
include Sys
let commandf format = Format.ksprintf Sys.command format
let ignore_commandf format =
Format.ksprintf (fun string -> ignore (Sys.command string)) format
end

let check_bad_test_case path = fun () ->
Expand Down Expand Up @@ -61,8 +63,8 @@ let check_good_test_case path = fun () ->
if rc != 0 then Alcotest.fail "Morbig was supposed to succeed and failed instead"
);
(
ignore (Sys.commandf "cat %s/input.sh.sjson | jq . > %s/input.sh.sjson.clean" qpath qpath);
ignore (Sys.commandf "mv %s/input.sh.sjson.clean %s/input.sh.sjson" qpath qpath);
Sys.ignore_commandf "cat %s/input.sh.sjson | jq . > %s/input.sh.sjson.clean" qpath qpath;
Sys.ignore_commandf "mv %s/input.sh.sjson.clean %s/input.sh.sjson" qpath qpath;
let rc = Sys.commandf "diff %s/input.sh.sjson %s/expected.json 2>&1 >/dev/null" qpath qpath in
if rc != 0 then Alcotest.fail "Diff is not happy with Morbig's output"
)
Expand Down

0 comments on commit 92b9a05

Please sign in to comment.