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

Function TestGzReadErrorEmpty

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

Source from the content-addressed store, hash-verified

57}
58
59func TestGzReadErrorEmpty(t *testing.T) {
60 var empty bytes.Buffer
61
62 r, err := newFastGzReader(&empty)
63 if err != nil {
64 // Error detected, OK
65 t.Log(err)
66 return
67 }
68
69 _, err = io.ReadAll(r)
70 if err != nil {
71 // Error detected, OK
72 t.Log(err)
73 return
74 }
75
76 err = r.Close()
77 if err != nil {
78 // Error detected, OK
79 t.Log(err)
80 return
81 }
82
83 t.Fatal("error not detected")
84}
85
86func TestGzReadErrorInvalid(t *testing.T) {
87 wrong := "ciaociaociaociao"

Callers

nothing calls this directly

Calls 2

newFastGzReaderFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected