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()) }
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 TestKeysDiffer(t *testing.T) { k1 := httpcache.NewKey("GET", mustParseUrl("http://x.org/test"), nil) k2 := httpcache.NewKey("GET", mustParseUrl("http://y.org/test"), nil) assert.NotEqual(t, k1.String(), k2.String()) }