We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dda460 commit 78c609fCopy full SHA for 78c609f
internal/util/eventual_test.go
@@ -0,0 +1,37 @@
1
+package util
2
+
3
+import (
4
+ "time"
5
6
+ "github.com/10gen/migration-verifier/option"
7
+)
8
9
+func (s *UnitTestSuite) TestEventual() {
10
+ eventual := NewEventual[int]()
11
12
+ s.Assert().Equal(
13
+ option.None[int](),
14
+ eventual.Get(),
15
+ "Get() should return empty",
16
+ )
17
18
+ select {
19
+ case <-eventual.Ready():
20
+ s.Require().Fail("should not be ready")
21
+ case <-time.NewTimer(time.Second).C:
22
+ }
23
24
+ eventual.Set(123)
25
26
27
28
29
+ s.Require().Fail("should be ready")
30
31
32
33
+ option.Some(123),
34
35
+ "Get() should return the value",
36
37
+}
0 commit comments