You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
702 B
29 lines
702 B
package regx
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestRegx_ContainChinese(t *testing.T) {
|
|
fmt.Println(regx.ContainChinese("中文"))
|
|
fmt.Println(regx.ContainChinese("abc"))
|
|
fmt.Println(regx.ContainChinese("中文abc"))
|
|
}
|
|
|
|
func TestRegx_Contains(t *testing.T) {
|
|
fmt.Println(regx.IsAlpha("中文"))
|
|
fmt.Println(regx.IsAlpha("abc"))
|
|
fmt.Println(regx.IsAlpha("中文abc"))
|
|
fmt.Println(regx.IsAllUpper("中文"))
|
|
fmt.Println(regx.IsAllUpper("abc"))
|
|
fmt.Println(regx.IsAllUpper("中文abc"))
|
|
}
|
|
|
|
func TestRegx_IsFloatStr(t *testing.T) {
|
|
fmt.Println(regx.IsFloatStr("1.1"))
|
|
fmt.Println(regx.IsFloatStr("1.1.1"))
|
|
fmt.Println(regx.IsFloatStr("3"))
|
|
fmt.Println(regx.IsJSON("{\"name\":\"中文\"}"))
|
|
}
|