mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-09 00:14:57 +00:00
29 lines
451 B
Go
29 lines
451 B
Go
// +build unit
|
|
|
|
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)
|
|
}
|
|
}
|
|
}
|