mirror of https://github.com/fluffle/goirc
Functions are not comparable any more, so only compare event names.
This commit is contained in:
parent
6fd04236fb
commit
a78aed7e7c
|
@ -91,8 +91,12 @@ func TestClientAndStateTracking(t *testing.T) {
|
||||||
l := logging.NewMockLogger(ctrl)
|
l := logging.NewMockLogger(ctrl)
|
||||||
st := state.NewMockStateTracker(ctrl)
|
st := state.NewMockStateTracker(ctrl)
|
||||||
|
|
||||||
for n, h := range intHandlers {
|
for n, _ := range intHandlers {
|
||||||
r.EXPECT().AddHandler(h, n)
|
// We can't use EXPECT() here as comparisons of functions are
|
||||||
|
// no longer valid in Go, which causes reflect.DeepEqual to bail.
|
||||||
|
// Instead, ignore the function arg and just ensure that all the
|
||||||
|
// handler names are correctly passed to AddHandler.
|
||||||
|
ctrl.RecordCall(r, "AddHandler", gomock.Any(), []string{n})
|
||||||
}
|
}
|
||||||
c := Client("test", "test", "Testing IRC", r, l)
|
c := Client("test", "test", "Testing IRC", r, l)
|
||||||
|
|
||||||
|
@ -109,8 +113,9 @@ func TestClientAndStateTracking(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// OK, while we're here with a mock event registry...
|
// OK, while we're here with a mock event registry...
|
||||||
for n, h := range stHandlers {
|
for n, _ := range stHandlers {
|
||||||
r.EXPECT().AddHandler(h, n)
|
// See above.
|
||||||
|
ctrl.RecordCall(r, "AddHandler", gomock.Any(), []string{n})
|
||||||
}
|
}
|
||||||
c.EnableStateTracking()
|
c.EnableStateTracking()
|
||||||
|
|
||||||
|
@ -127,8 +132,9 @@ func TestClientAndStateTracking(t *testing.T) {
|
||||||
me := c.Me
|
me := c.Me
|
||||||
c.ST = st
|
c.ST = st
|
||||||
st.EXPECT().Wipe()
|
st.EXPECT().Wipe()
|
||||||
for n, h := range stHandlers {
|
for n, _ := range stHandlers {
|
||||||
r.EXPECT().DelHandler(h, n)
|
// See above.
|
||||||
|
ctrl.RecordCall(r, "DelHandler", gomock.Any(), []string{n})
|
||||||
}
|
}
|
||||||
c.DisableStateTracking()
|
c.DisableStateTracking()
|
||||||
if c.st || c.ST != nil || c.Me != me {
|
if c.st || c.ST != nil || c.Me != me {
|
||||||
|
|
Loading…
Reference in New Issue