Codebase list golang-github-googleapis-gax-go / upstream/0.0_git20170902.8c160ca header_test.go
upstream/0.0_git20170902.8c160ca

Tree @upstream/0.0_git20170902.8c160ca (Download .tar.gz)

header_test.go @upstream/0.0_git20170902.8c160caraw · history · blame

package gax

import "testing"

func TestXGoogHeader(t *testing.T) {
	for _, tst := range []struct {
		kv   []string
		want string
	}{
		{nil, ""},
		{[]string{"abc", "def"}, "abc/def"},
		{[]string{"abc", "def", "xyz", "123", "foo", ""}, "abc/def xyz/123 foo/"},
	} {
		got := XGoogHeader(tst.kv...)
		if got != tst.want {
			t.Errorf("Header(%q) = %q, want %q", tst.kv, got, tst.want)
		}
	}
}