eventer: fix tests
This commit is contained in:
parent
a38dafcc57
commit
7c9508ed71
@ -3,7 +3,7 @@ package eventer
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestChannel(t *testing.T) {
|
func TestChannel(t *testing.T) {
|
||||||
eventer := New(nil)
|
eventer := New()
|
||||||
|
|
||||||
c := make(Channel, 1)
|
c := make(Channel, 1)
|
||||||
eventer.RegisterChannel("test", c)
|
eventer.RegisterChannel("test", c)
|
||||||
@ -17,7 +17,7 @@ func TestChannel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFunction(t *testing.T) {
|
func TestFunction(t *testing.T) {
|
||||||
eventer := New(nil)
|
eventer := New()
|
||||||
|
|
||||||
var data string
|
var data string
|
||||||
eventer.RegisterFunc("test", func(ev Event) {
|
eventer.RegisterFunc("test", func(ev Event) {
|
||||||
@ -31,7 +31,7 @@ func TestFunction(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRegister(t *testing.T) {
|
func TestRegister(t *testing.T) {
|
||||||
eventer := New(nil)
|
eventer := New()
|
||||||
|
|
||||||
c := eventer.Register("test")
|
c := eventer.Register("test")
|
||||||
eventer.Post("test", "hello world")
|
eventer.Post("test", "hello world")
|
||||||
@ -44,7 +44,7 @@ func TestRegister(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOn(t *testing.T) {
|
func TestOn(t *testing.T) {
|
||||||
eventer := New(nil)
|
eventer := New()
|
||||||
|
|
||||||
c := make(Channel, 1)
|
c := make(Channel, 1)
|
||||||
eventer.On("test", c)
|
eventer.On("test", c)
|
||||||
|
Loading…
Reference in New Issue
Block a user