(tests
 (names testarg testerror)
 (modes js wasm))

(rule
 (target test_rest_all.ml.corrected)
 (action
  (run node %{dep:../expect.bc.js} %{dep:test_rest_all.ml})))

(rule
 (alias runtest-js)
 (action
  (diff test_rest_all.ml test_rest_all.ml.corrected)))

(rule
 (copy test_rest_all.ml test_rest_all_wasm.ml))

(rule
 (target test_rest_all_wasm.ml.corrected)
 (enabled_if
  (and
   %{env:WASM_OF_OCAML=false}
   (<> %{profile} wasi)
   (<> %{profile} wasi-with-native-effects)))
 (action
  (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_rest_all_wasm.ml})))

(rule
 (alias runtest-wasm)
 (enabled_if
  (and
   %{env:WASM_OF_OCAML=false}
   (<> %{profile} wasi)
   (<> %{profile} wasi-with-native-effects)))
 (action
  (diff test_rest_all.ml test_rest_all_wasm.ml.corrected)))
