server: 平台抽象层+bilibili、服务端加密凭据库、角色中间件;web: 精简页面/路由、macOS 客户端(Swift)与多份方案文档;移除误入库的编译产物
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package handlers
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidPairCode(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
code string
|
||||
want bool
|
||||
}{
|
||||
{name: "valid", code: "AB23CD", want: true},
|
||||
{name: "ambiguous characters rejected", code: "AB01CD", want: false},
|
||||
{name: "lowercase rejected before normalization", code: "ab12cd", want: false},
|
||||
{name: "wrong length", code: "AB12C", want: false},
|
||||
{name: "unicode rejected", code: "AB12CD", want: false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := validPairCode(tt.code); got != tt.want {
|
||||
t.Fatalf("validPairCode(%q) = %v, want %v", tt.code, got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user