(t *testing.T)
| 584 | } |
| 585 | |
| 586 | func TestBuildOnlyFileCommaFlags(t *testing.T) { |
| 587 | c := &BuildCommand{ |
| 588 | Meta: TestMetaFile(t), |
| 589 | } |
| 590 | |
| 591 | args := []string{ |
| 592 | "-parallel-builds=1", |
| 593 | "-only=chocolate,vanilla", |
| 594 | filepath.Join(testFixture("build-only"), "template.json"), |
| 595 | } |
| 596 | |
| 597 | defer cleanup() |
| 598 | |
| 599 | if code := c.Run(args); code != 0 { |
| 600 | fatalCommand(t, c.Meta) |
| 601 | } |
| 602 | |
| 603 | for _, f := range []string{"chocolate.txt", "vanilla.txt", |
| 604 | "apple.txt", "peach.txt", "pear.txt", "unnamed.txt"} { |
| 605 | if !fileExists(f) { |
| 606 | t.Errorf("Expected to find %s", f) |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | if fileExists("cherry.txt") { |
| 611 | t.Error("Expected NOT to find cherry.txt") |
| 612 | } |
| 613 | |
| 614 | if !fileExists("tomato.txt") { |
| 615 | t.Error("Expected to find tomato.txt") |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | func TestBuildStdin(t *testing.T) { |
| 620 | c := &BuildCommand{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…