MCPcopy Create free account
hub / github.com/WICG/webpackage / TestIndexSectionMultipleResourcesPerURL

Function TestIndexSectionMultipleResourcesPerURL

go/bundle/encoder_test.go:102–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestIndexSectionMultipleResourcesPerURL(t *testing.T) {
103 url := urlMustParse("https://example.com/")
104 is := &indexSection{}
105 is.addExchange(
106 &Exchange{
107 Request{URL: url},
108 Response{},
109 }, 10, 1)
110 is.addExchange(
111 &Exchange{
112 Request{URL: url},
113 Response{},
114 }, 20, 1)
115 err := is.Finalize(version.VersionB2)
116 if err.Error() != "This WebBundle version 'b2' does not support variants, so we cannot have multiple resources per URL." {
117 t.Fatal(err)
118 }
119}

Callers

nothing calls this directly

Calls 3

addExchangeMethod · 0.95
FinalizeMethod · 0.95
urlMustParseFunction · 0.70

Tested by

no test coverage detected