Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have a cpan module with the following tests that has failed smoke testing on a Windows machine. It is choking on these tests:

stderr_like { `bin/anki_import` } qr/usage: anki_import FILE/, 'dies w +ithout file'; stderr_like { `bin/anki_import blasdfah` } qr/[FATAL].*does not exist/ +, 'dies with bad file'; lives_ok { `bin/anki_import t/data/source.anki` } 'can process good fi +le';

Looks like Windows is getting confused by the forward slash. Here is the reported error:

# Failed test 'dies without file' # at t/02-cli.t line 22. # STDERR: # 'bin' is not recognized as an internal or external command, # operable program or batch file.

Do I need to detect the OS and write a special command for Windows? Maybe I can just cd into the bin and execute from there? What's the best fix for this?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks


In reply to Testing CLI commands on Windows machines by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found