From eb44ca5fe20fff67ea27aaab20646524b191ffe2 Mon Sep 17 00:00:00 2001 From: pocke Date: Mon, 12 Jan 2015 13:00:07 +0900 Subject: [PATCH] add test --- goevent_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/goevent_test.go b/goevent_test.go index e0978ce..10917bd 100644 --- a/goevent_test.go +++ b/goevent_test.go @@ -70,6 +70,20 @@ func TestManyOn(t *testing.T) { } } +func TestManyArgs(t *testing.T) { + e := goevent.New() + var res []int + e.On(func(i, j, k int) { + res = append(res, i) + res = append(res, j) + res = append(res, k) + }) + e.Trigger(1, 2, 3) + if !(res[0] == 1 && res[1] == 2 && res[2] == 3) { + t.Errorf("res expected %v, but got %v", []int{1, 2, 3}, res) + } +} + func TestOnWhenNotFunction(t *testing.T) { p := goevent.New() err := p.On("foobar")