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\":\"中文\"}")) }