Files
huangguo_server/common/truthutil/truthutil_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

39 lines
728 B
Go

package truthutil
import "testing"
func TestCheckURIAndNumberAllowsXiGreeting(t *testing.T) {
t.Parallel()
for _, content := range []string{
"嘻嘻",
"嘻嘻,我在这里",
"西西",
} {
content := content
t.Run(content, func(t *testing.T) {
t.Parallel()
if !checkURIAndNumber(content) {
t.Fatalf("checkURIAndNumber(%q) = false, want true", content)
}
})
}
}
func TestCheckURIAndNumberStillRejectsURLs(t *testing.T) {
t.Parallel()
for _, content := range []string{
"abc.com",
"abc点com",
} {
content := content
t.Run(content, func(t *testing.T) {
t.Parallel()
if checkURIAndNumber(content) {
t.Fatalf("checkURIAndNumber(%q) = true, want false", content)
}
})
}
}