1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-16 11:54:29 +00:00
arikawa/bot/nameflag_test.go

27 lines
435 B
Go
Raw Normal View History

2020-01-19 06:06:00 +00:00
package bot
import "testing"
func TestNameFlag(t *testing.T) {
type entry struct {
Name string
Expect NameFlag
String string
}
var entries = []entry{{
Name: "AーEcho",
Expect: AdminOnly,
}, {
Name: "RAーGC",
Expect: Raw | AdminOnly,
}}
for _, entry := range entries {
var f, _ = ParseFlag(entry.Name)
if !f.Is(entry.Expect) {
t.Fatalf("unexpected expectation for %s: %v", entry.Name, f)
}
}
}