| 1 | //go:build linux |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import "testing" |
| 6 | |
| 7 | func TestParseHelperPhaseLine(t *testing.T) { |
| 8 | phase, ok := parseHelperPhaseLine(helperPhasePrefix + "installing") |
| 9 | if !ok || phase != "installing" { |
| 10 | t.Fatalf("got %q %v", phase, ok) |
| 11 | } |
| 12 | if _, ok := parseHelperPhaseLine("E: Could not get lock"); ok { |
| 13 | t.Fatal("apt noise must not parse as phase") |
| 14 | } |
| 15 | if _, ok := parseHelperPhaseLine(helperPhasePrefix); ok { |
| 16 | t.Fatal("empty phase must not parse") |
| 17 | } |
| 18 | } |
| 19 |