MCPcopy
hub / github.com/grpc/grpc-go / TestEventDoneChannel

Method TestEventDoneChannel

internal/xds/clients/internal/syncutil/event_test.go:48–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func (s) TestEventDoneChannel(t *testing.T) {
49 e := NewEvent()
50 select {
51 case <-e.Done():
52 t.Fatal("e.HasFired() = true; want false")
53 default:
54 }
55 if !e.Fire() {
56 t.Fatal("e.Fire() = false; want true")
57 }
58 select {
59 case <-e.Done():
60 default:
61 t.Fatal("e.HasFired() = false; want true")
62 }
63}
64
65func (s) TestEventMultipleFires(t *testing.T) {
66 e := NewEvent()

Callers

nothing calls this directly

Calls 4

DoneMethod · 0.95
FireMethod · 0.95
NewEventFunction · 0.70
FatalMethod · 0.65

Tested by

no test coverage detected