MCPcopy
hub / github.com/valyala/fasthttp / TestArgsStringCompose

Function TestArgsStringCompose

args_test.go:391–408  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

389}
390
391func TestArgsStringCompose(t *testing.T) {
392 t.Parallel()
393
394 var a Args
395 a.Set("foo", "bar")
396 a.Set("aa", "bbb")
397 a.Set("привет", "мир")
398 a.SetNoValue("bb")
399 a.Set("", "xxxx")
400 a.Set("cvx", "")
401 a.SetNoValue("novalue")
402
403 expectedS := "foo=bar&aa=bbb&%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82=%D0%BC%D0%B8%D1%80&bb&=xxxx&cvx=&novalue"
404 s := a.String()
405 if s != expectedS {
406 t.Fatalf("Unexpected string %q. Expected %q", s, expectedS)
407 }
408}
409
410func TestArgsString(t *testing.T) {
411 t.Parallel()

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
SetNoValueMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…