@@ -812,18 +812,36 @@ func TestExecute_Completion(t *testing.T) {
812
812
Execute ()
813
813
814
814
bash := filepath .Join (os .Getenv ("HOME" ), ".bash_completion" )
815
- if ! file .IsFile (bash ) {
816
- t .Errorf ("not generate %s" , bash )
815
+ if runtime .GOOS == "windows" {
816
+ if file .IsFile (bash ) {
817
+ t .Errorf ("generate %s, however shell completion file is not generated on Windows" , bash )
818
+ }
819
+ } else {
820
+ if ! file .IsFile (bash ) {
821
+ t .Errorf ("failed to generate %s" , bash )
822
+ }
817
823
}
818
824
819
825
fish := filepath .Join (os .Getenv ("HOME" ), ".config" , "fish" , "completions" , cmdinfo .Name + ".fish" )
820
- if ! file .IsFile (fish ) {
821
- t .Errorf ("not generate %s" , fish )
826
+ if runtime .GOOS == "windows" {
827
+ if file .IsFile (fish ) {
828
+ t .Errorf ("generate %s, however shell completion file is not generated on Windows" , fish )
829
+ }
830
+ } else {
831
+ if ! file .IsFile (fish ) {
832
+ t .Errorf ("failed to generate %s" , fish )
833
+ }
822
834
}
823
835
824
836
zsh := filepath .Join (os .Getenv ("HOME" ), ".zsh" , "completion" , "_" + cmdinfo .Name )
825
- if ! file .IsFile (zsh ) {
826
- t .Errorf ("not generate %s" , zsh )
837
+ if runtime .GOOS == "windows" {
838
+ if file .IsFile (zsh ) {
839
+ t .Errorf ("generate %s, however shell completion file is not generated on Windows" , zsh )
840
+ }
841
+ } else {
842
+ if ! file .IsFile (zsh ) {
843
+ t .Errorf ("failed to generate %s" , zsh )
844
+ }
827
845
}
828
846
})
829
847
}
0 commit comments