hf
hf copied to clipboard
Tests fail on Windows.
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.
I think now runcmd.go works on both systems.
But I have gnuwin cat installed... it will probably fail for you.
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,
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.
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.
Dear Nicholas,
Could you be so kind to generate .exe
for the rest of us who are mere Windows users w/o compiler?