github.com/fumiama/NanoBot@v0.0.0-20231122134259-c22d8183efca/http_test.go (about) 1 package nano 2 3 import "testing" 4 5 func TestWriteHTTPQueryIfNotNil(t *testing.T) { 6 expstr := "https://api.sgroup.qq.com/testapi?b=1&d=0.5" 7 str := WriteHTTPQueryIfNotNil(OpenAPI+"/testapi", "a", 0, "b", 1, "c", "", "d", 0.5) 8 if str != expstr { 9 t.Fatal("expected", expstr, "but got", str) 10 } 11 }