(t *testing.T)
| 189 | } |
| 190 | |
| 191 | func TestInputFileLoop(t *testing.T) { |
| 192 | rnd := rand.Int63() |
| 193 | |
| 194 | file, _ := os.OpenFile(fmt.Sprintf("/tmp/%d", rnd), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0660) |
| 195 | file.Write([]byte("1 1 1\ntest1")) |
| 196 | file.Write([]byte(payloadSeparator)) |
| 197 | file.Write([]byte("1 1 2\ntest2")) |
| 198 | file.Write([]byte(payloadSeparator)) |
| 199 | file.Close() |
| 200 | |
| 201 | input := NewFileInput(fmt.Sprintf("/tmp/%d", rnd), true, 100, 0, false) |
| 202 | |
| 203 | // Even if we have just 2 requests in file, it should indifinitly loop |
| 204 | for i := 0; i < 1000; i++ { |
| 205 | input.PluginRead() |
| 206 | } |
| 207 | |
| 208 | input.Close() |
| 209 | os.Remove(file.Name()) |
| 210 | } |
| 211 | |
| 212 | func TestInputFileCompressed(t *testing.T) { |
| 213 | rnd := rand.Int63() |
nothing calls this directly
no test coverage detected