mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:01:09 +02:00
mana-search-go → mana-search mana-notify-go → mana-notify mana-crawler-go → mana-crawler mana-api-gateway-go → mana-api-gateway Legacy NestJS versions are deleted, suffix no longer needed. Updated all references in docker-compose, CLAUDE.md, package.json, Forgejo workflows, and service package.json files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
762 B
Go
31 lines
762 B
Go
package channel
|
|
|
|
import "testing"
|
|
|
|
func TestIsExpoPushToken(t *testing.T) {
|
|
tests := []struct {
|
|
token string
|
|
want bool
|
|
}{
|
|
{"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]", true},
|
|
{"ExpoPushToken[xxxxxxxxxxxxxxxxxxxxxx]", true},
|
|
{"ExponentPushToken[abc123]", true},
|
|
{"ExpoPushToken[abc123]", true},
|
|
{"ExponentPushToken[]", true},
|
|
{"", false},
|
|
{"some-random-token", false},
|
|
{"Bearer ExponentPushToken[abc]", false},
|
|
{"exponentpushtoken[abc]", false}, // case sensitive
|
|
{"ExpoPush[abc]", false},
|
|
{"fcm:token123", false},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.token, func(t *testing.T) {
|
|
got := IsExpoPushToken(tt.token)
|
|
if got != tt.want {
|
|
t.Fatalf("IsExpoPushToken(%q) = %v, want %v", tt.token, got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|