mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-06 00:27:00 +08:00
优化
This commit is contained in:
16
server/util/string_test.go
Normal file
16
server/util/string_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCheckSafeString(t *testing.T) {
|
||||
// 测试正常字符串
|
||||
if StringUtil.CheckSafeString("abc123") {
|
||||
t.Log("正常字符串")
|
||||
}
|
||||
// 测试包含特殊字符的字符串
|
||||
if !StringUtil.CheckSafeString("abc123!") {
|
||||
t.Log("包含特殊字符的字符串")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user