MCPcopy Index your code
hub / github.com/coder/coder / buildTestZip

Function buildTestZip

archive/archive_test.go:55–70  ·  view source on GitHub ↗
(t *testing.T, files map[string]string)

Source from the content-addressed store, hash-verified

53}
54
55func buildTestZip(t *testing.T, files map[string]string) []byte {
56 t.Helper()
57
58 var zipBytes bytes.Buffer
59 zw := zip.NewWriter(&zipBytes)
60 for name, contents := range files {
61 w, err := zw.Create(name)
62 require.NoError(t, err)
63
64 _, err = w.Write([]byte(contents))
65 require.NoError(t, err)
66 }
67 require.NoError(t, zw.Close())
68
69 return zipBytes.Bytes()
70}
71
72func TestCreateTarFromZip_RejectsOversizedAggregateExpansion(t *testing.T) {
73 t.Parallel()

Calls 5

HelperMethod · 0.65
CreateMethod · 0.65
WriteMethod · 0.65
CloseMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected