Skip to content

Commit

Permalink
Use filepath for joins to fix windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danawoodman committed Feb 27, 2024
1 parent 8be47db commit eeef491
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"io"
"os"
"os/exec"
"path"
"path/filepath"
"syscall"
"testing"
Expand Down Expand Up @@ -87,9 +86,9 @@ func TestCng(t *testing.T) {
if curDir == "" {
wd, err := os.Getwd()
assert.NoError(t, err)
curDir = path.Join(wd, "..")
curDir = filepath.Join(wd, "..")
}
binDir := path.Join(curDir, "dist")
binDir := filepath.Join(curDir, "dist")

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down Expand Up @@ -207,7 +206,7 @@ func command(t *testing.T, binDir string, stdout, stderr io.Writer, conf conf) *
}
parts = append(parts, conf.pattern)
parts = append(parts, "--", "echo", "hello")
cmd := exec.Command(path.Join(binDir, "cng"), parts...)
cmd := exec.Command(filepath.Join(binDir, "cng"), parts...)
cmd.Stdout = stdout
cmd.Stderr = stderr
return cmd
Expand Down

0 comments on commit eeef491

Please sign in to comment.