Skip to content

Commit

Permalink
Compare file contents ignoring Windows-specific line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Jan 22, 2023
1 parent b8a6071 commit d391605
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"os"
"strings"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -70,7 +71,8 @@ func testApp() *App {
func expectFileContent(t *testing.T, file, expected string) {
data, err := os.ReadFile(file)
require.Nil(t, err)
require.Equal(t, string(data), expected)

require.Equal(t, strings.ReplaceAll(string(data), "\r\n", "\n"), expected)
}

func TestFishCompletion(t *testing.T) {
Expand Down

0 comments on commit d391605

Please sign in to comment.