mcchunkie/plugins/salute_test.go
donuts-are-good 9006558a58
Adding o7 "Salute"
Salute ( o7 ) is the intergalactic sign for a salute. Chunks should return an o7 when saluted by a worthy member.
2022-05-31 20:40:44 -05:00

21 lines
398 B
Go

package plugins
import (
"testing"
)
func TestSaluteMatch(t *testing.T) {
testStrings := make(map[string]bool)
testStrings["o7"] = true
testStrings[`7o`] = false
testStrings["_o"] = false
testStrings["o_"] = false
h := &Salute{}
for msg, should := range testStrings {
if h.Match("", msg) != should {
t.Errorf("Salute expected to match %q (%t); but doesn't\n", msg, should)
}
}
}