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

(rule
 (alias runtest-js)
 (enabled_if
  (>= %{ocaml_version} 5.2))
 (action
  (diff test_array.ml test_array.ml.corrected)))

(rule
 (copy test_array.ml test_array_wasm.ml))

(rule
 (target test_array_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_array_wasm.ml})))

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