Skip to content

Commit 86abf78

Browse files
committed
Fix string escape sequences in tests (#21)
1 parent cec4f6e commit 86abf78

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/appcall_windows_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tests
22

33
import (
44
"fmt"
5+
"strings"
56
"testing"
67

78
"github.com/stretchr/testify/require"
@@ -10,7 +11,7 @@ import (
1011
func TestDirCallSuccess(t *testing.T) {
1112
transpileBatchFunc(t, func(dir string) string {
1213
return `
13-
` + fmt.Sprintf(`var a = @dir("/B", "%s")`, dir) + `
14+
` + fmt.Sprintf(`var a = @dir("/B", "%s")`, strings.ReplaceAll(dir, `\`, `\\`)) + `
1415
1516
print(a)
1617
`
@@ -23,7 +24,7 @@ func TestDirCallSuccess(t *testing.T) {
2324
func TestDirCallPipeToFindstrCallSuccess(t *testing.T) {
2425
transpileBatchFunc(t, func(dir string) string {
2526
return `
26-
` + fmt.Sprintf(`var a = @dir("/B", "%s") | @findstr(".tsh")`, dir) + `
27+
` + fmt.Sprintf(`var a = @dir("/B", "%s") | @findstr(".tsh")`, strings.ReplaceAll(dir, `\`, `\\`)) + `
2728
2829
print(a)
2930
`

0 commit comments

Comments
 (0)