mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-30 18:53:30 +00:00
27 lines
435 B
Go
27 lines
435 B
Go
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|