Files
huangguo_server/web/service/moduleser/drama_module_test.go
T
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

22 lines
622 B
Go

package moduleser
import (
"testing"
"91porn-server/models/v/moduleconfmod"
)
func TestValidateDramaModuleName(t *testing.T) {
for _, name := range []string{"AI短剧", "热门短剧", "Drama Hot"} {
if err := validateDramaModuleName(moduleconfmod.Drama, name); err != nil {
t.Fatalf("valid module name %q rejected: %v", name, err)
}
}
if err := validateDramaModuleName(moduleconfmod.Drama, "短剧"); err == nil {
t.Fatal("ambiguous drama module name unexpectedly accepted")
}
if err := validateDramaModuleName(1, "任意名称"); err != nil {
t.Fatalf("non-drama module was affected: %v", err)
}
}