kefu/tools/test_test.go

23 lines
417 B
Go
Raw Permalink Normal View History

2024-12-10 02:50:12 +00:00
package tools
import (
"log"
"net/url"
"strings"
"testing"
)
func TestUrlEncode(t *testing.T) {
str := "aabb,&8?%s"
ret := url.QueryEscape(str)
log.Println(ret)
encodedValue := "Hell%C3%B6+W%C3%B6rld%40Golang"
decodedValue, err := url.QueryUnescape(encodedValue)
log.Println(decodedValue, err)
}
func TestContains(t *testing.T) {
b := strings.Contains("blog.baidu.com", "*.baidu.com")
log.Println(b)
}