MCPcopy Index your code
hub / github.com/foxcpp/maddy / TestFuture_SetBeforeGet

Function TestFuture_SetBeforeGet

framework/future/future_test.go:28–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestFuture_SetBeforeGet(t *testing.T) {
29 f := New()
30
31 f.Set(1, errors.New("1"))
32 val, err := f.Get()
33 if err.Error() != "1" {
34 t.Error("Wrong error:", err)
35 }
36
37 if val, _ := val.(int); val != 1 {
38 t.Fatal("wrong val received from Get")
39 }
40}
41
42func TestFuture_Wait(t *testing.T) {
43 f := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
SetMethod · 0.45
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected