hf icon indicating copy to clipboard operation
hf copied to clipboard

Tests fail on Windows.

Open baileyn opened this issue 8 years ago • 6 comments

The default tests for runcmd_test.go fail on windows. By default hf uses cat $FILES and cat $FILES | wc -l as test commands. On Windows, cat is an alias in Powershell. When the default shell is changed to use powershell -Command instead of cmd /c, the cat command works for one file, but it will not work for multiple files.

baileyn avatar Jul 14 '15 00:07 baileyn

I think now runcmd.go works on both systems.

hugows avatar Jul 14 '15 11:07 hugows

But I have gnuwin cat installed... it will probably fail for you.

hugows avatar Jul 14 '15 12:07 hugows

I ran the test on windows, and it passed fine. I was using the powershell terminal, but I don't think that really matters considering cmd /c is called from runCmdWithArgs,

baileyn avatar Jul 14 '15 16:07 baileyn

I still testing what is the best behaviour there - use cmd /c for everything, let the user choose (current behaviour), use heuristics to find out what kind of programs should be called with shell, etc.

On 14 July 2015 at 13:09, Nicholas Bailey [email protected] wrote:

I ran the test on windows, and it passed fine. I was using the powershell terminal, but I don't think that really matters considering "cmd /c" is called from runCmdWithArgs,

— Reply to this email directly or view it on GitHub https://github.com/hugows/hf/issues/5#issuecomment-121292781.

hugows avatar Jul 14 '15 16:07 hugows

I would say either let the user choose the default command to be used, or check if powershell exists, and if not default down to cmd.

powershell -Command is the equivalent of cmd /c, but powershell has aliases such as ls, cat, and a few others which cmd will refuse to execute.

baileyn avatar Jul 14 '15 16:07 baileyn

Dear Nicholas, Could you be so kind to generate .exe for the rest of us who are mere Windows users w/o compiler?

sergeevabc avatar May 18 '21 21:05 sergeevabc