MCPcopy Index your code
hub / github.com/probelabs/goreplay / TestInputFileCompressed

Function TestInputFileCompressed

input_file_test.go:212–236  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

210}
211
212func TestInputFileCompressed(t *testing.T) {
213 rnd := rand.Int63()
214
215 output := NewFileOutput(fmt.Sprintf("/tmp/%d_0.gz", rnd), &FileOutputConfig{FlushInterval: time.Minute, Append: true})
216 for i := 0; i < 1000; i++ {
217 output.PluginWrite(&Message{Meta: []byte("1 1 1\r\n"), Data: []byte("test")})
218 }
219 name1 := output.file.Name()
220 output.Close()
221
222 output2 := NewFileOutput(fmt.Sprintf("/tmp/%d_1.gz", rnd), &FileOutputConfig{FlushInterval: time.Minute, Append: true})
223 for i := 0; i < 1000; i++ {
224 output2.PluginWrite(&Message{Meta: []byte("1 1 1\r\n"), Data: []byte("test")})
225 }
226 name2 := output2.file.Name()
227 output2.Close()
228
229 input := NewFileInput(fmt.Sprintf("/tmp/%d*", rnd), false, 100, 0, false)
230 for i := 0; i < 2000; i++ {
231 input.PluginRead()
232 }
233
234 os.Remove(name1)
235 os.Remove(name2)
236}
237
238type CaptureFile struct {
239 msgs []*Message

Callers

nothing calls this directly

Calls 5

PluginWriteMethod · 0.95
CloseMethod · 0.95
PluginReadMethod · 0.95
NewFileOutputFunction · 0.85
NewFileInputFunction · 0.85

Tested by

no test coverage detected