Skip to content

Commit 211d609

Browse files
committed
Fix line splitting on Windows
1 parent 2402b29 commit 211d609

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

go/expression_examples_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ func TestExamples(t *testing.T) {
1616
require.NoError(t, err)
1717

1818
chunks := strings.Split(string(examples), "---")
19+
newLine := regexp.MustCompile("\r?\n")
1920
for _, chunk := range chunks {
20-
lines := strings.Split(strings.TrimSpace(chunk), "\r?\n")
21+
lines := newLine.Split(strings.TrimSpace(chunk), -1)
2122
expressionText, text, expectedArgs := lines[0], lines[1], lines[2]
2223
t.Run(fmt.Sprintf("works with %s", expressionText), func(t *testing.T) {
2324
args := MatchExample(t, expressionText, text)

0 commit comments

Comments
 (0)