File: client_handler_test.go

package info (click to toggle)
golang-gopkg-irc.v4 4.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 244 kB
  • sloc: python: 63; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 338 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package irc_test

import (
	"testing"

	"github.com/stretchr/testify/assert"

	"gopkg.in/irc.v4"
)

func TestHandlerFunc(t *testing.T) {
	t.Parallel()

	hit := false
	var f irc.HandlerFunc = func(c *irc.Client, m *irc.Message) {
		hit = true
	}

	f.Handle(nil, nil)
	assert.True(t, hit, "HandlerFunc doesn't work correctly as Handler")
}