44 "os"
55 "os/exec"
66 "path/filepath"
7+ "runtime"
78 "strings"
89 "testing"
910
@@ -173,17 +174,21 @@ func TestResolveScriptAiderScopedByEnvFindsHistoryFiles(t *testing.T) {
173174 require .NoError (t , err , "resolve script failed: output: %s" , out )
174175
175176 dirs , _ := parseResolvedDirs (string (out ))
176- assert .ElementsMatch (t , []string {historyA , historyB }, dirs [parser .AgentAider ],
177+ aiderTargets := slashPaths (dirs [parser .AgentAider ])
178+ assert .ElementsMatch (t , []string {filepath .ToSlash (historyA ), filepath .ToSlash (historyB )}, aiderTargets ,
177179 "explicit AIDER_DIR must resolve only aider history files" )
178- assert .NotContains (t , dirs [ parser . AgentAider ], codeRoot ,
180+ assert .NotContains (t , aiderTargets , filepath . ToSlash ( codeRoot ) ,
179181 "AIDER_DIR itself must not become a tar target" )
180- assert .NotContains (t , dirs [ parser . AgentAider ], skippedHistory ,
182+ assert .NotContains (t , aiderTargets , filepath . ToSlash ( skippedHistory ) ,
181183 "remote aider discovery must prune local-discovery skip dirs" )
182- assert .NotContains (t , dirs [ parser . AgentAider ], deepHistory ,
184+ assert .NotContains (t , aiderTargets , filepath . ToSlash ( deepHistory ) ,
183185 "remote aider discovery must enforce the local depth cap" )
184186}
185187
186188func TestResolveScriptAiderNewlinePathCannotInjectTarget (t * testing.T ) {
189+ if runtime .GOOS == "windows" {
190+ t .Skip ("Windows path APIs reject embedded newlines; this regression covers POSIX remote shell output" )
191+ }
187192 home := t .TempDir ()
188193 codeRoot := filepath .Join (home , "code" )
189194 injected := "/home/victim/" + parser .AiderHistoryFileName ()
@@ -207,6 +212,14 @@ func TestResolveScriptAiderNewlinePathCannotInjectTarget(t *testing.T) {
207212 }
208213}
209214
215+ func slashPaths (paths []string ) []string {
216+ out := make ([]string , len (paths ))
217+ for i , p := range paths {
218+ out [i ] = filepath .ToSlash (p )
219+ }
220+ return out
221+ }
222+
210223// TestResolveScriptAiderRejectsHomeOverride verifies that setting AIDER_DIR
211224// to literal $HOME (the very thing the home-default skip prevents) is also
212225// dropped, so an unscoped override cannot reintroduce a whole-home tar.
0 commit comments