@@ -531,39 +531,39 @@ func TestDetermineProperCommand(t *testing.T) {
531
531
},
532
532
{
533
533
name : "bin set to absolute path" ,
534
- bin : "/ usr/ local/ bin/ gptscript" ,
535
- dir : "/ usr/ local" ,
536
- want : "/ usr/ local/ bin/ gptscript" ,
534
+ bin : string ( os . PathSeparator ) + filepath . Join ( " usr" , " local" , " bin" , " gptscript") ,
535
+ dir : string ( os . PathSeparator ) + filepath . Join ( " usr" , " local") ,
536
+ want : string ( os . PathSeparator ) + filepath . Join ( " usr" , " local" , " bin" , " gptscript") ,
537
537
},
538
538
{
539
539
name : "bin set to relative path" ,
540
- bin : "../ bin/ gptscript" ,
541
- dir : "/ usr/ local" ,
542
- want : "../ bin/ gptscript" ,
540
+ bin : filepath . Join ( ".." , " bin" , " gptscript") ,
541
+ dir : string ( os . PathSeparator ) + filepath . Join ( " usr" , " local") ,
542
+ want : filepath . Join ( ".." , " bin" , " gptscript") ,
543
543
},
544
544
{
545
545
name : "bin set to relative 'to me' path with os.Args[0]" ,
546
- bin : "<me>/../ bin/ gptscript" ,
546
+ bin : "<me>" + string ( os . PathSeparator ) + filepath . Join ( ".." , " bin" , " gptscript") ,
547
547
dir : filepath .Dir (os .Args [0 ]),
548
- want : filepath .Join (filepath .Dir (os .Args [0 ]), "../ bin/ gptscript" ),
548
+ want : filepath .Join (filepath .Dir (os .Args [0 ]), filepath . Join ( ".." , " bin" , " gptscript") ),
549
549
},
550
550
{
551
551
name : "env var set to relative 'to me' path with extra and dir is current" ,
552
- bin : "<me>/../ bin/ gptscript" ,
553
- dir : "./ " ,
554
- want : "./../ bin/ gptscript" ,
552
+ bin : "<me>" + string ( os . PathSeparator ) + filepath . Join ( ".." , " bin" , " gptscript") ,
553
+ dir : "." ,
554
+ want : "." + string ( os . PathSeparator ) + filepath . Join ( ".." , " bin" , " gptscript") ,
555
555
},
556
556
{
557
557
name : "env var set to relative 'to me' path and dir is current" ,
558
- bin : "<me>/ gptscript" ,
559
- dir : "./ " ,
560
- want : "./ gptscript" ,
558
+ bin : "<me>" + string ( os . PathSeparator ) + " gptscript" ,
559
+ dir : "." ,
560
+ want : "." + string ( os . PathSeparator ) + " gptscript" ,
561
561
},
562
562
{
563
563
name : "env var set to relative 'to me' path with extra and dir is current" ,
564
- bin : "<me>/../ bin/ gptscript" ,
565
- dir : "./ " ,
566
- want : "./../ bin/ gptscript" ,
564
+ bin : "<me>" + string ( os . PathSeparator ) + filepath . Join ( ".." , " bin" , " gptscript") ,
565
+ dir : "." ,
566
+ want : "." + string ( os . PathSeparator ) + filepath . Join ( ".." , " bin" , " gptscript") ,
567
567
},
568
568
}
569
569
for _ , tt := range tests {
0 commit comments