(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestHookLength(t *testing.T) { |
| 54 | h := Hook[*Event]{} |
| 55 | |
| 56 | if l := h.Length(); l != 0 { |
| 57 | t.Fatalf("Expected 0 hook handlers, got %d", l) |
| 58 | } |
| 59 | |
| 60 | h.BindFunc(func(e *Event) error { return e.Next() }) |
| 61 | h.BindFunc(func(e *Event) error { return e.Next() }) |
| 62 | |
| 63 | if l := h.Length(); l != 2 { |
| 64 | t.Fatalf("Expected 2 hook handlers, got %d", l) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func TestHookUnbind(t *testing.T) { |
| 69 | h := Hook[*Event]{} |