Merge pull request #21786 from pselle/fmt_check_test

tests: Normalize in the fmt -check test
This commit is contained in:
Pam Selle 2019-06-18 17:50:19 -04:00 committed by GitHub
commit 250527d923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -245,6 +245,10 @@ func TestFmt_check(t *testing.T) {
t.Fatalf("wrong exit code. expected 3")
}
// Given that we give relative paths back to the user, normalize this temp
// dir so that we're comparing against a relative-ized (normalized) path
tempDir = c.normalizePath(tempDir)
if actual := ui.OutputWriter.String(); !strings.Contains(actual, tempDir) {
t.Fatalf("expected:\n%s\n\nto include: %q", actual, tempDir)
}