9006558a58
Salute ( o7 ) is the intergalactic sign for a salute. Chunks should return an o7 when saluted by a worthy member.
21 lines
398 B
Go
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)
|
|
}
|
|
}
|
|
}
|