MCPcopy Create free account
hub / github.com/AdRoll/baker / TestGzReadErrorInvalid

Function TestGzReadErrorInvalid

input/inpututils/fastgzreader_test.go:86–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestGzReadErrorInvalid(t *testing.T) {
87 wrong := "ciaociaociaociao"
88
89 r, err := newFastGzReader(strings.NewReader(wrong))
90 if err != nil {
91 // Error detected, OK
92 t.Log(err)
93 return
94 }
95
96 _, err = io.ReadAll(r)
97 if err != nil {
98 // Error detected, OK
99 t.Log(err)
100 return
101 }
102
103 err = r.Close()
104 if err != nil {
105 // Error detected, OK
106 t.Log(err)
107 return
108 }
109
110 t.Fatal("error not detected")
111}
112
113func BenchmarkGzip(b *testing.B) {
114 data := getCorpus()

Callers

nothing calls this directly

Calls 2

newFastGzReaderFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected