From 8c648d09762ed12672f6ff9539a7bbb18fd008e9 Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Thu, 23 Apr 2020 08:53:27 +0300 Subject: [PATCH] Test Lwt.Syntax.{(let+),(and+)} Follow-on to #776. --- test/core/test_lwt.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/core/test_lwt.ml b/test/core/test_lwt.ml index ba7b66941b..3810670279 100644 --- a/test/core/test_lwt.ml +++ b/test/core/test_lwt.ml @@ -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]