MCPcopy Create free account
hub / github.com/hpcloud/tail / TestBlockUntilExists

Function TestBlockUntilExists

tail_test.go:295–315  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

293}
294
295func 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
317func maxLineSize(t *testing.T, follow bool, fileContent string, expected []string) {
318 tailTest := NewTailTest("maxlinesize", t)

Callers

nothing calls this directly

Calls 7

StartTailMethod · 0.95
CreateFileMethod · 0.95
RemoveFileMethod · 0.95
NewTailTestFunction · 0.85
FatalfMethod · 0.80
StopMethod · 0.80
CleanupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…