@@ -524,10 +524,14 @@ func TestDetectGOPATH(t *testing.T) {
524
524
th .TempDir (filepath .Join ("code" , "src" , "github.com" , "username" , "package" ))
525
525
th .TempDir (filepath .Join ("go" , "src" , "github.com" , "username" , "package" ))
526
526
th .TempDir (filepath .Join ("gotwo" , "src" , "github.com" , "username" , "package" ))
527
+ th .TempDir (filepath .Join ("gothree" , "sep" , "src" , "github.com" , "username" , "package" ))
528
+
529
+ sep := string (os .PathSeparator )
527
530
528
531
ctx := & Ctx {GOPATHs : []string {
529
532
th .Path ("go" ),
530
533
th .Path ("gotwo" ),
534
+ th .Path ("gothree" ) + sep + sep + "sep" ,
531
535
}}
532
536
533
537
testcases := []struct {
@@ -538,6 +542,8 @@ func TestDetectGOPATH(t *testing.T) {
538
542
{th .Path ("go" ), th .Path (filepath .Join ("go" , "src" , "github.com" , "username" , "package" )), false },
539
543
{th .Path ("go" ), th .Path (filepath .Join ("go" , "src" , "github.com" , "username" , "package" )), false },
540
544
{th .Path ("gotwo" ), th .Path (filepath .Join ("gotwo" , "src" , "github.com" , "username" , "package" )), false },
545
+ {th .Path (filepath .Join ("gothree" , "sep" )),
546
+ th .Path (filepath .Join ("gothree" , "sep" , "src" , "github.com" , "username" , "package" )), false },
541
547
{"" , th .Path (filepath .Join ("code" , "src" , "github.com" , "username" , "package" )), true },
542
548
}
543
549
@@ -547,7 +553,7 @@ func TestDetectGOPATH(t *testing.T) {
547
553
t .Error ("expected error but got none" )
548
554
}
549
555
if GOPATH != tc .GOPATH {
550
- t .Errorf ("expected GOPATH to be %s, got %s" , GOPATH , tc . GOPATH )
556
+ t .Errorf ("expected GOPATH to be %s, got %s" , tc . GOPATH , GOPATH )
551
557
}
552
558
}
553
559
}
0 commit comments