(t *testing.T)
| 5 | ) |
| 6 | |
| 7 | func TestParentExit(t *testing.T) { |
| 8 | env, procs := testEnv() |
| 9 | child, err := startChild(env, nil) |
| 10 | if err != nil { |
| 11 | t.Fatal(err) |
| 12 | } |
| 13 | |
| 14 | proc := <-procs |
| 15 | _, exited, err := proc.notify() |
| 16 | if err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | |
| 20 | readyFile := <-child.ready |
| 21 | if _, err = readyFile.Write([]byte{1}); err != nil { |
| 22 | t.Fatal("Can't inject garbage from parent") |
| 23 | } |
| 24 | if err := readyFile.Close(); err != nil { |
| 25 | t.Fatal(err) |
| 26 | } |
| 27 | |
| 28 | err = <-exited |
| 29 | if err == nil { |
| 30 | t.Fatal("Expect child to detect garbage from parent") |
| 31 | } |
| 32 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…