(t *testing.T)
| 26 | ) |
| 27 | |
| 28 | func 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 | |
| 42 | func TestFuture_Wait(t *testing.T) { |
| 43 | f := New() |