From acb2ad569f3e2d38453a13778a1f6ec84f7069aa Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Fri, 21 Jul 2023 14:26:51 +0300 Subject: [PATCH] Get MDX tests working on Windows --- README.md | 11 ++++++++++- dune | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32680abf..57ec8f27 100644 --- a/README.md +++ b/README.md @@ -752,12 +752,17 @@ Eio.Io Net Connection_failure Refused Unix_error (Connection refused, "connect", ``` If we ran this using another backend, the `Unix_error` part might change. -To avoid this problem, you can use `Eio.Exn.Backend.show` to hide the backend-specific part of errors: +To avoid this problem, you can use `Eio.Exn.Backend.show` ```ocaml # Eio.Exn.Backend.show := false;; - : unit = () +``` + +to hide the backend-specific part of errors: + +```ocaml # Eio_main.run @@ fun env -> let net = Eio.Stdenv.net env in Switch.run @@ fun sw -> @@ -892,6 +897,7 @@ perhaps with `open_dir` to constrain all access to be within that directory. Spawning a child process can be done using the [Eio.Process][] module: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -903,6 +909,7 @@ hello There are various optional arguments for setting the process's current directory or connecting up the standard streams. For example, we can use `tr` to convert some text to upper-case: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -915,6 +922,7 @@ ONE TWO THREE If you want to capture the output of a process, you can provide a suitable `Eio.Flow.sink` as the `stdout` argument, or use the `parse_out` convenience wrapper: + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in @@ -924,6 +932,7 @@ or use the `parse_out` convenience wrapper: All process functions either return the exit status or check that it was zero (success): + ```ocaml # Eio_main.run @@ fun env -> let proc_mgr = Eio.Stdenv.process_mgr env in diff --git a/dune b/dune index 5c5a1c5c..904da8b2 100644 --- a/dune +++ b/dune @@ -2,5 +2,4 @@ (package eio_main) (deps (package eio_main) (package kcas) (env_var "EIO_BACKEND")) (preludes doc/prelude.ml) - (enabled_if (<> %{os_type} "Win32")) (files README.md))