MCPcopy Create free account
hub / github.com/assembla/cony / TestPublisher_Cancel_willNotBlock

Function TestPublisher_Cancel_willNotBlock

publisher_test.go:44–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestPublisher_Cancel_willNotBlock(t *testing.T) {
45 var (
46 ok bool
47 runSync = make(chan bool)
48 )
49 p := newTestPublisher()
50
51 go func() {
52 <-runSync
53 p.Cancel()
54 p.Cancel()
55 p.Cancel()
56 ok = true
57 runSync <- true
58 }()
59
60 runSync <- true
61 <-runSync
62 if !ok {
63 t.Error("shold not block")
64 }
65}
66
67func TestPublisher_serve(t *testing.T) {
68 var (

Callers

nothing calls this directly

Calls 2

newTestPublisherFunction · 0.85
CancelMethod · 0.45

Tested by

no test coverage detected