on main help sign in
test: try fix windows tests
3cf895fKujtim Hoxha
internal/agent/common_test.go+7−1
@@ -5,6 +5,7 @@ import (
5 "net/http"
5 "net/http"
6 "os"
6 "os"
7 "path/filepath"
7 "path/filepath"
8+ "strings"
8 "testing"
9 "testing"
9 "time"
10 "time"
10
11
@@ -154,10 +155,15 @@ func coderAgent(r *recorder.Recorder, env env, large, small fantasy.LanguageMode
154 t, _ := time.Parse("1/2/2006", "1/1/2025")
155 t, _ := time.Parse("1/2/2006", "1/1/2025")
155 return t
156 return t
156 }
157 }
158+ path := filepath.ToSlash(env.workingDir)
159+ // try fixing windows
160+ if strings.Contains(path, ":") {
161+ path = strings.Split(path, ":")[1]
162+ }
157 prompt, err := coderPrompt(
163 prompt, err := coderPrompt(
158 prompt.WithTimeFunc(fixedTime),
164 prompt.WithTimeFunc(fixedTime),
159 prompt.WithPlatform("linux"),
165 prompt.WithPlatform("linux"),
160− prompt.WithWorkingDir(filepath.ToSlash(env.workingDir)),
166+ prompt.WithWorkingDir(path),
161 )
167 )
162 if err != nil {
168 if err != nil {
163 return nil, err
169 return nil, err