Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: New usage example for LWT #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,20 @@ as the former.
This is what you would need to write expect tests with Lwt:

#+begin_src ocaml
module Lwt_io_run = struct
module Lwt_io = struct
type 'a t = 'a Lwt.t
end

module Lwt_io_flush = struct
type 'a t = 'a Lwt.t
let return x = Lwt.return x
let bind x ~f = Lwt.bind x f
let to_run x = x
end

module Expect_test_config :
Expect_test_config_types.S
with module IO_run = Lwt_io_run
and module IO_flush = Lwt_io_flush = struct
module IO_run = Lwt_io_run
module IO_flush = Lwt_io_flush
module Expect_test_config : Expect_test_config_types.S with module IO = Lwt_io = struct
module IO = Lwt_io

let run x = Lwt_main.run (x ())
let upon_unreleasable_issue = `CR
let sanitize id = id
end
#+end_src

Expand Down