(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestBlockUntilExists(t *testing.T) { |
| 296 | tailTest := NewTailTest("block-until-file-exists", t) |
| 297 | config := Config{ |
| 298 | Follow: true, |
| 299 | } |
| 300 | tail := tailTest.StartTail("test.txt", config) |
| 301 | go func() { |
| 302 | time.Sleep(100 * time.Millisecond) |
| 303 | tailTest.CreateFile("test.txt", "hello world\n") |
| 304 | }() |
| 305 | for l := range tail.Lines { |
| 306 | if l.Text != "hello world" { |
| 307 | tailTest.Fatalf("mismatch; expected hello world, but got %s", |
| 308 | l.Text) |
| 309 | } |
| 310 | break |
| 311 | } |
| 312 | tailTest.RemoveFile("test.txt") |
| 313 | tail.Stop() |
| 314 | tail.Cleanup() |
| 315 | } |
| 316 | |
| 317 | func maxLineSize(t *testing.T, follow bool, fileContent string, expected []string) { |
| 318 | tailTest := NewTailTest("maxlinesize", t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…