Skip to content

Commit 304260c

Browse files
committed
classic windows, what a normal operating system
1 parent e136a1a commit 304260c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cli/dotfiles_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"path/filepath"
88
"runtime"
99
"testing"
10-
"unicode/utf16"
1110

1211
"github.com/stretchr/testify/require"
1312

@@ -310,7 +309,9 @@ func TestDotfilesInstallScriptWindows(t *testing.T) {
310309

311310
b, err := os.ReadFile(filepath.Join(string(root), "greeting.txt"))
312311
require.NoError(t, err)
313-
require.Equal(t, string(b), utf16.Encode([]rune("hello, computer!\n")))
312+
// If you squint, it does in fact say "hello, computer!" in here, but in
313+
// UTF-16 and with a byte-order-marker at the beginning. Windows!
314+
require.Equal(t, b, []byte("\xff\xfeh\x00e\x00l\x00l\x00o\x00,\x00 \x00c\x00o\x00m\x00p\x00u\x00t\x00e\x00r\x00!\x00\r\x00\n\x00"))
314315
})
315316
}
316317

0 commit comments

Comments
 (0)