(t *testing.T)
| 21 | ) |
| 22 | |
| 23 | func TestGetOverlayPath(t *testing.T) { |
| 24 | good := []string{"upperdir=/test/upper", "lowerdir=/test/lower1:/test/lower2", "workdir=/test/work"} |
| 25 | path, parents, err := getOverlayPath(good) |
| 26 | if err != nil { |
| 27 | t.Fatalf("Get overlay path failed: %v", err) |
| 28 | } |
| 29 | if path != "/test/upper" { |
| 30 | t.Fatalf("Unexpected upperdir: %q", path) |
| 31 | } |
| 32 | if len(parents) != 2 || parents[0] != "/test/lower1" || parents[1] != "/test/lower2" { |
| 33 | t.Fatalf("Unexpected parents: %v", parents) |
| 34 | } |
| 35 | |
| 36 | bad := []string{"lowerdir=/test/lower"} |
| 37 | _, _, err = getOverlayPath(bad) |
| 38 | if err == nil { |
| 39 | t.Fatalf("An error is expected") |
| 40 | } |
| 41 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…