Skip to content

Commit

Permalink
Revert fix_test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Feb 16, 2024
1 parent 37da45d commit fc97893
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions test/fix_test.go
Expand Up @@ -4,7 +4,6 @@ import (
"os"
"os/exec"
"path/filepath"
"regexp"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -72,7 +71,7 @@ func TestFix(t *testing.T) {
expectedOutput, err := os.ReadFile(filepath.Join(testdataDir, "fix", "out", filepath.Base(input)))
require.NoError(t, err)

require.Equal(t, trimTrailingSpaces(string(expectedOutput)), trimTrailingSpaces(string(output)))
require.Equal(t, string(expectedOutput), string(output))
})
}
}
Expand Down Expand Up @@ -111,13 +110,7 @@ func TestFix_pathPrefix(t *testing.T) {
expectedOutput, err := os.ReadFile(filepath.Join(testdataDir, "fix", "out", filepath.Base(input)))
require.NoError(t, err)

require.Equal(t, trimTrailingSpaces(string(expectedOutput)), trimTrailingSpaces(string(output)))
require.Equal(t, string(expectedOutput), string(output))
})
}
}

var reTrailingSpaces = regexp.MustCompile(`(?m)(\s+)$`)

func trimTrailingSpaces(s string) string {
return reTrailingSpaces.ReplaceAllString(s, "")
}
2 changes: 1 addition & 1 deletion test/testdata/fix/out/go-header_1.go
@@ -1,5 +1,5 @@
// Copyright 2024 The Awesome Project Authors
//
//
// Use of this source code is governed by LICENSE

//golangcitest:args -Egoheader
Expand Down

0 comments on commit fc97893

Please sign in to comment.