合并 origin/main 设备注册后,纳入本地 music 模块、seed 命令与 popadmin 相关路由/文档;music migration 编号为 0020 以避免与 0019_devices 冲突。 Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
638 B
Go
25 lines
638 B
Go
package entity
|
|
|
|
import "testing"
|
|
|
|
func TestBotEmailAndSparkID(t *testing.T) {
|
|
if BotEmail(0) != "" || BotEmail(101) != "" {
|
|
t.Fatal("out of range")
|
|
}
|
|
if got := BotEmail(1); got != "bot001@spark.bot" {
|
|
t.Fatalf("email %s", got)
|
|
}
|
|
if got := BotEmail(100); got != "bot100@spark.bot" {
|
|
t.Fatalf("email %s", got)
|
|
}
|
|
if !IsBotEmail("bot001@spark.bot") || !IsBotEmail("BOT050@SPARK.BOT") {
|
|
t.Fatal("IsBotEmail true")
|
|
}
|
|
if IsBotEmail("test01@spark.com") || IsBotEmail("bot101@spark.bot") {
|
|
t.Fatal("IsBotEmail false")
|
|
}
|
|
if sid := BotSparkID(7); sid != "sparkbot007" || !ValidSparkID(sid) {
|
|
t.Fatalf("spark_id %s", sid)
|
|
}
|
|
}
|