parent
e1ccdce4d4
commit
55fabac5cc
@ -0,0 +1,19 @@
|
|||||||
|
package gorequest
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestParams(t *testing.T) {
|
||||||
|
params1 := NewParams()
|
||||||
|
params2 := NewParams()
|
||||||
|
params1.Set("a", "1")
|
||||||
|
params2.Set("b", "2")
|
||||||
|
params3 := NewParamsWith(params1, params2)
|
||||||
|
log.Println(params1.DeepCopy())
|
||||||
|
log.Println(params2.DeepCopy())
|
||||||
|
log.Println(params3.DeepCopy())
|
||||||
|
log.Println(params1.DeepCopy())
|
||||||
|
log.Println(params2.DeepCopy())
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package gorequest
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestUrlParse(t *testing.T) {
|
||||||
|
t.Logf("%+v", UriParse("https://api.dtapp.net/ip?ip=127.0.0.1#history"))
|
||||||
|
t.Logf("%+v", UriParse("https://test:abcd123@golangbyexample.com:8000/tutorials/intro?type=advance&compact=false#history"))
|
||||||
|
t.Logf("%+v", UriFilterExcludeQueryString("/"))
|
||||||
|
t.Logf("%+v", UriFilterExcludeQueryString("/favicon.ico"))
|
||||||
|
t.Logf("%+v", UriFilterExcludeQueryString("/ip"))
|
||||||
|
t.Logf("%+v", UriFilterExcludeQueryString("/ip?ip=127.0.0.1"))
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package gorequest
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGetRandomUserAgentSystem(t *testing.T) {
|
||||||
|
t.Log(GetRandomUserAgentSystem())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetRandomUserAgent(t *testing.T) {
|
||||||
|
t.Log(GetRandomUserAgent())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDtaUa(t *testing.T) {
|
||||||
|
t.Log(DtaUa())
|
||||||
|
}
|
Loading…
Reference in new issue