package entity import "testing" func TestIsTestEmail(t *testing.T) { ok := []string{"test01@spark.com", "test10@spark.com", "TEST05@SPARK.COM"} for _, e := range ok { if !IsTestEmail(e) { t.Fatalf("want test %s", e) } } bad := []string{"test00@spark.com", "test11@spark.com", "test1@spark.com", "other@spark.com", "test01@example.com"} for _, e := range bad { if IsTestEmail(e) { t.Fatalf("not test %s", e) } } }