Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for newMockReader (0.13 sec)

  1. internal/s3select/jstream/scanner_test.go

    		}
    		t.Logf("pos=%d remaining=%d (%s)", i, r.Len(), string(c))
    		i++
    	}
    }
    
    type mockReader struct {
    	pos       int
    	mockData  byte
    	failAfter int
    }
    
    func newMockReader(failAfter int, data byte) *mockReader {
    	return &mockReader{0, data, failAfter}
    }
    
    func (r *mockReader) Read(p []byte) (n int, err error) {
    	if r.pos >= r.failAfter {
    Registered: Sun Oct 27 19:28:09 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. internal/s3select/jstream/decoder_test.go

    	}
    	if counter != 0 {
    		t.Fatalf("expected 0 items, got %d", counter)
    	}
    }
    
    func TestDecoderReaderFailure(t *testing.T) {
    	var (
    		failAfter = 900
    		mockData  = byte('[')
    	)
    
    	r := newMockReader(failAfter, mockData)
    	decoder := NewDecoder(r, -1)
    
    	for mv := range decoder.Stream() {
    		t.Logf("depth=%d offset=%d len=%d (%v)", mv.Depth, mv.Offset, mv.Length, mv.Value)
    	}
    
    	err := decoder.Err()
    Registered: Sun Oct 27 19:28:09 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 6.6K bytes
    - Viewed (0)
Back to top