Update test for builder output

This commit is contained in:
Chris Gilmer 2020-08-11 15:01:05 -07:00
parent 5016df92b8
commit 6e918c4bd3
No known key found for this signature in database
GPG Key ID: 9B9B5634A88AB754
1 changed files with 3 additions and 5 deletions

View File

@ -336,13 +336,11 @@ func Test_build_output(t *testing.T) {
{[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local.pkr.hcl")}, nil, {[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local.pkr.hcl")}, nil,
` `
null.example: hello from the NULL builder packeruser null.example: hello from the NULL builder packeruser
Build 'null.example' finished. Build 'null.example' finished after`, "posix"},
`, "posix"},
{[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local-windows.pkr.hcl")}, nil, {[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local-windows.pkr.hcl")}, nil,
` `
null.example: hello from the NULL builder packeruser null.example: hello from the NULL builder packeruser
Build 'null.example' finished. Build 'null.example' finished after`, "windows"},
`, "windows"},
} }
for _, tc := range tc { for _, tc := range tc {
@ -357,7 +355,7 @@ Build 'null.example' finished.
t.Fatalf("%v: %s", err, bs) t.Fatalf("%v: %s", err, bs)
} }
if !strings.Contains(string(bs), tc.expected) { if !strings.Contains(string(bs), tc.expected) {
t.Fatalf("Should have given output %s.\nReceived: %s", tc.expected, string(bs)) t.Fatalf("Should contain output %s.\nReceived: %s", tc.expected, string(bs))
} }
}) })
} }