Fix line endings in hclfmt test

This commit is contained in:
James Nugent 2016-03-21 00:17:10 +00:00
parent 1e8f2d1561
commit 9832b69cfd

View File

@ -11,6 +11,8 @@ import (
"sort"
"syscall"
"testing"
"github.com/hashicorp/hcl/testhelper"
)
var fixtureExtensions = []string{"hcl"}
@ -324,6 +326,8 @@ func TestRunDiff(t *testing.T) {
}
}
expectedOutString := testhelper.Unix2dos(expectedOut.String())
_, stdout := mockIO()
err = Run(
[]string{path},
@ -337,8 +341,8 @@ func TestRunDiff(t *testing.T) {
if err != nil {
t.Errorf("unexpected error: %s", err)
}
if !regexp.MustCompile(expectedOut.String()).Match(stdout.Bytes()) {
t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOut, stdout)
if !regexp.MustCompile(expectedOutString).Match(stdout.Bytes()) {
t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOutString, stdout)
}
}