mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 21:02:25 +08:00
* feat: 添加query 以及query单元测试 feat: 添加模板字符串解析以及模板字符串单元测试 * improve: 序列化请求参数,使得参数更易读 * delete: delete useless module * format: format code * docs: add function comment * docs: comment method * fix: fixed type convert error * feat: support any type * feat: support other type * format: format code * test: check logger * format: format code * test: udpate testing case * del: remove useless code * del: remove useless module * test: update testing case * ✨ feat: support for unsigned integers * ✨ feat: template string support any type
21 lines
435 B
Go
21 lines
435 B
Go
package util
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestTemplate testing case about Template method
|
|
func TestTemplate(t *testing.T) {
|
|
result := Template("{name}={age};{with}={another};any={any};boolean={boolean}", map[string]interface{}{
|
|
"name": "Helan",
|
|
"age": "33",
|
|
"with": "Pep",
|
|
"another": "C",
|
|
"any": 33,
|
|
"boolean": false,
|
|
})
|
|
if result != "Helan=33;Pep=C;any=33;boolean=false" {
|
|
t.Error("NOT PSS testing")
|
|
}
|
|
}
|