vendor: add qingstor-sdk-go for QingStor

This commit is contained in:
wuyu
2017-08-04 17:09:28 +01:00
committed by Nick Craig-Wood
parent f682002b84
commit 466dd22b44
136 changed files with 15952 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestURLQueryEscape(t *testing.T) {
assert.Equal(t, "/", URLQueryEscape("/"))
assert.Equal(t, "%20", URLQueryEscape(" "))
assert.Equal(t,
"%21%40%23%24%25%5E%26%2A%28%29_%2B%7B%7D%7C",
URLQueryEscape("!@#$%^&*()_+{}|"),
)
}
func TestURLQueryUnescape(t *testing.T) {
x, err := URLQueryUnescape("/")
assert.Nil(t, err)
assert.Equal(t, "/", x)
x, err = URLQueryUnescape("%20")
assert.Nil(t, err)
assert.Equal(t, " ", x)
x, err = URLQueryUnescape("%21%40%23%24%25%5E%26%2A%28%29_%2B%7B%7D%7C")
assert.Nil(t, err)
assert.Equal(t, "!@#$%^&*()_+{}|", x)
}