1 package http 2 3 import "testing" 4 5 func TestUserAgentBuilder(t *testing.T) { 6 b := NewUserAgentBuilder() 7 b.AddKeyValue("foo", "1.2.3") 8 b.AddKey("baz") 9 if e, a := "foo/1.2.3 baz", b.Build(); e != a { 10 t.Errorf("expect %v, got %v", e, a) 11 } 12 } 13