IPC-Run icon indicating copy to clipboard operation
IPC-Run copied to clipboard

basic test for spaces and args

Open wchristian opened this issue 3 years ago • 2 comments

This serves as a demonstration for the problems in #143.

As far as i understand IPC::Run and comments as https://github.com/toddr/IPC-Run/pull/143#issuecomment-851759322 , all of the calls below should work on windows, right?

Because right now (as well as with older versions) it looks like only these succeed:

ipctest.bat
.\ipctest.bat
dirnospace\ipctest.bat
D:\cpan\IPC-Run\eg\ipctest.bat
D:\cpan\IPC-Run\eg\dirnospace\ipctest.bat
D:/cpan/IPC-Run/eg/ipctest.bat
D:/cpan/IPC-Run/eg/dirnospace/ipctest.bat

Notable failures:

  • spaces in dirs
  • spaces in executable
  • forward slashes in relative paths

Interestingly i was unable to reproduce the failure indicated by @stphnlyd in https://github.com/toddr/IPC-Run/pull/143#issuecomment-825792859

Note that i didn't yet consider the actual output of what's being run deeply, this mostly focuses on actually running it and getting basic arg behavior right. TODO: .exe files, .exe files with non-standard arg parsing, maybe more complicated args?

Comment invitation for @nmisch, @haarg, @toddr. (I think mohawk gets pinged automatically.)

run [ $_, "meep marp" ], ">", $out;

for all of

ipctest.bat
ipctest2 space.bat
.\ipctest.bat
./ipctest.bat
.\ipctest2 space.bat
./ipctest2 space.bat
dirnospace\ipctest.bat
dirnospace/ipctest.bat
dirnospace\ipctest2 space.bat
dirnospace/ipctest2 space.bat
dir space\ipctest.bat
dir space/ipctest.bat
dir space\ipctest2 space.bat
dir space/ipctest2 space.bat
D:\cpan\IPC-Run\eg\ipctest.bat
D:\cpan\IPC-Run\eg\ipctest2 space.bat
D:\cpan\IPC-Run\eg\dirnospace\ipctest.bat
D:\cpan\IPC-Run\eg\dirnospace\ipctest2 space.bat
D:\cpan\IPC-Run\eg\dir space\ipctest.bat
D:\cpan\IPC-Run\eg\dir space\ipctest2 space.bat
D:/cpan/IPC-Run/eg/ipctest.bat
D:/cpan/IPC-Run/eg/ipctest2 space.bat
D:/cpan/IPC-Run/eg/dirnospace/ipctest.bat
D:/cpan/IPC-Run/eg/dirnospace/ipctest2 space.bat
D:/cpan/IPC-Run/eg/dir space/ipctest.bat
D:/cpan/IPC-Run/eg/dir space/ipctest2 space.bat

wchristian avatar Jun 01 '21 18:06 wchristian

Can you rebase this please?

toddr avatar Aug 10 '22 12:08 toddr

I like the concept! I do think it would be better to capture all the tested files into a module and generate them in a tempdir, in a similar style to EUMM's https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/blob/master/t/lib/MakeMaker/Test/Setup/XS.pm

mohawk2 avatar Aug 11 '22 20:08 mohawk2