Files
xiaolajiaoyyds 6f71df4849 Initial open-source release
多平台账号批量注册系统,支持 OpenAI / Grok / Kiro / Gemini 平台的全自动注册。

Features:
- 用户名/密码注册登录(首个用户自动管理员)
- JWT 认证 + bcrypt 密码加密
- 积分系统与多用户管理
- HuggingFace Space 弹性 Worker 节点管理
- Cloudflare Worker 负载均衡
- 实时日志推送(SSE/WebSocket)
- 管理后台(用户管理、系统设置、代理池、卡池)

Tech Stack: Go 1.25 / Gin / GORM / PostgreSQL / Vue 3 / Vite / TailwindCSS
2026-03-22 03:44:42 +08:00

56 lines
1.2 KiB
Go

package tempmail
import "testing"
func TestExtractVerificationCode(t *testing.T) {
t.Parallel()
tests := []struct {
name string
subject string
body string
want string
}{
{
name: "openai_subject_tail_digits",
subject: "Your ChatGPT code is 798357",
want: "798357",
},
{
name: "gemini_body_keyword_alnum",
body: "Your Google verification code is L655U3",
want: "L655U3",
},
{
name: "gemini_html_block_code",
body: `<html><body><p>Your one-time verification code is:</p><div>DZJW4P</div></body></html>`,
want: "DZJW4P",
},
{
name: "quoted_printable_body",
body: "Your verification code=20is=20AB12C3",
want: "AB12C3",
},
{
name: "numeric_body_without_keyword_context",
body: "Use this one-time passcode on the next page: 456789",
want: "456789",
},
{
name: "seven_digit_body_code",
body: "Your backup verification number is 1234567",
want: "1234567",
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
if got := ExtractVerificationCode(tc.subject, tc.body); got != tc.want {
t.Fatalf("ExtractVerificationCode() = %q, want %q", got, tc.want)
}
})
}
}