Skip to content

Commit

Permalink
Test Lwt.Syntax.{(let+),(and+)}
Browse files Browse the repository at this point in the history
Follow-on to #776.
  • Loading branch information
aantron committed Apr 23, 2020
1 parent d7fabaa commit 8c648d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/core/test_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3931,6 +3931,20 @@ let let_syntax_tests = suite "let syntax" [
Lwt.wakeup r2 "bar";
state_is (Lwt.Return "foobar") p'
end;

test "let+/and+" begin fun () ->
let p1, r1 = Lwt.wait () in
let p2, r2 = Lwt.wait () in
let p' =
let open Lwt.Syntax in
let+ s1 = p1
and+ s2 = p2 in
(s1 ^ s2)
in
Lwt.wakeup r1 "foo";
Lwt.wakeup r2 "bar";
state_is (Lwt.Return "foobar") p'
end;
]
let suites = suites @ [let_syntax_tests]

Expand Down

0 comments on commit 8c648d0

Please sign in to comment.