feat: add EncodeUrl function

This commit is contained in:
dudaodong committed 2022-07-15 16:29:41 +08:00
1 parent 47ecfbfd5f
commit 506a8b4776
2 files changed
+26

No files matched your search

+13
View File
@@ -96,3 +96,16 @@ func TestGetMacAddrs(t *testing.T) {
macAddrs := GetMacAddrs()
t.Log(macAddrs)
}
func TestEncodeUrl(t *testing.T) {
assert := internal.NewAssert(t, "TestIsInternalIP")
urlAddr := "http://www.lancet.com?a=1&b=[2]"
encodedUrl, err := EncodeUrl(urlAddr)
if err != nil {
t.Log(err)
}
expected := "http://www.lancet.com?a=1&b=%5B2%5D"
assert.Equal(expected, encodedUrl)
}