mcchunkie/plugins/beat_test.go

23 lines
504 B
Go
Raw Permalink Normal View History

2020-03-09 07:43:48 -06:00
package plugins
import (
"testing"
)
2020-03-13 15:05:08 -06:00
func TestBeatMatch(t *testing.T) {
2020-03-09 07:43:48 -06:00
testStrings := make(map[string]bool)
testStrings["what time is it??!!?!"] = true
testStrings["what time is it"] = false
testStrings["man: 2 pledge"] = false
testStrings[".beat"] = true
testStrings["beattime?"] = true
testStrings["beat time?"] = true
b := &Beat{}
for msg, should := range testStrings {
if b.Match("", msg) != should {
t.Errorf("Beat expected to match %q (%t); but doesn't\n", msg, should)
}
}
}