MCPcopy
hub / github.com/smallstep/cli / TestSkipOnlyZeroReader

Function TestSkipOnlyZeroReader

utils/internal/utfbom/utfbom_test.go:193–215  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestSkipOnlyZeroReader(t *testing.T) {
194 var z zeroReader
195
196 c := make(chan *Reader)
197 go func() {
198 r := SkipOnly(z)
199 c <- r
200 }()
201
202 select {
203 case r := <-c:
204 var b [1]byte
205 n, err := r.Read(b[:])
206 if n != 0 {
207 t.Error("unexpected bytes count:", n)
208 }
209 if !errors.Is(err, io.ErrNoProgress) {
210 t.Error("unexpected error:", err)
211 }
212 case <-time.After(time.Second):
213 t.Error("test timed out (endless loop in Skip?)")
214 }
215}
216
217func TestReader_ReadEmpty(t *testing.T) {
218 for _, tc := range testCases {

Callers

nothing calls this directly

Calls 3

SkipOnlyFunction · 0.85
ReadMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…