func TestVaryKey(t *testing.T) { r := newRequest("GET", "http://x.org/test", "Llamas-1: true", "Llamas-2: false") k1 := httpcache.NewRequestKey(r) k2 := httpcache.NewRequestKey(r).Vary("Llamas-1, Llamas-2", r) assert.NotEqual(t, k1.String(), k2.String()) }
func TestRequestKeyWithIllegalContentLocation(t *testing.T) { r := newRequest("GET", "http://x.org/test1", "Content-Location: http://y.org/test2") k1 := httpcache.NewKey("GET", mustParseUrl("http://x.org/test1"), nil) k2 := httpcache.NewRequestKey(r) assert.Equal(t, k1.String(), k2.String()) }
func TestRequestKey(t *testing.T) { r := newRequest("GET", "http://x.org/test") k1 := httpcache.NewKey("GET", mustParseUrl("http://x.org/test"), nil) k2 := httpcache.NewRequestKey(r) assert.Equal(t, k1.String(), k2.String()) }