From 826d1f15c857c41951338e2915259f3731c475e6 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 14 Jun 2023 11:34:44 -0400 Subject: [PATCH] add test --- test/t_futs1.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/t_futs1.ml b/test/t_futs1.ml index 7f782836..185989e5 100644 --- a/test/t_futs1.ml +++ b/test/t_futs1.ml @@ -109,3 +109,13 @@ let () = in ignore (Fut.wait_block_exn (Fut.join_list [ fut1; fut2 ]) : _ list); assert (Atomic.get n = 99 * 100) + +let () = + let f1 = mk_ret_delay 0.1 "foo" in + assert ( + try + ignore (Fut.get_or_fail f1); + false + with Fut.Not_ready -> true); + ignore (Fut.wait_block f1); + assert (Fut.get_or_fail f1 = Ok "foo")