Skip to content

Commit 2d1a205

Browse files
committed
Fix internal/capture/extended_data_test.go
1 parent 6b45e55 commit 2d1a205

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/capture/extended_data_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ func TestExtendedData_Run_Success(t *testing.T) {
2626
if err != nil {
2727
t.Fatalf("Failed to create temp dir: %v", err)
2828
}
29-
defer os.RemoveAll(testDir)
29+
defer os.RemoveAll(scriptDir)
3030

3131
// Step 2: Define paths
3232
outputFile := filepath.Join(testDir, "output.log")
33-
scriptFile := filepath.Join(scriptDir, "test-script.bat")
33+
scriptFile := ""
3434

3535
// Step 3: Create a simple .bat script
3636
var scriptContent = ""
3737
if runtime.GOOS == "windows" {
3838
scriptContent = "@echo off\r\necho test-data > \"" + outputFile + "\"\r\n"
39+
scriptFile = filepath.Join(scriptDir, "test-script.bat")
3940
} else {
40-
scriptContent = "#!/bin/sh \r\necho test-data > \"" + outputFile + "\"\r\n"
41+
scriptContent = "#!/bin/sh\necho test-data > " + outputFile + "\n"
42+
scriptFile = filepath.Join(scriptDir, "test-script.sh")
4143
}
4244

4345
err = os.WriteFile(scriptFile, []byte(scriptContent), 0777)

0 commit comments

Comments
 (0)