In developing my latest module, I've run into a problem that I haven't been able to easily solve through the usual testing mechanisms. These modules need to parse a vendor supplied spread sheet, and then format the data to match what we have in our database.

The first problem is that the vendor supplied price sheets are seldom consistent, even even when coming from the same vendor, so there are some run time control mechanisms that I've been using in the application to control that.

The second problem is that, depending on the type of product line, products should be formatted differently, and after speaking with some of the operations folks, they've decided that the easiest way might be to have whoever is importing the price sheet do a visual check of the output.

So in the first case, I would like to be able to specify to the test a couple items at run time (like the vendor and the price sheet), and in the second, I would like the test to display an example of the output and ask the user if it looks okay.

Unfortunately my efforts to pass in command line parameters (make test VENDOR /path/to/file) to the test using:

my $vendor - shift @ARGV; my $price_file = shift @ARGV;
Appear to have failed, but I must confess that this appearance of failure may be that Test::More is swallowing up all standard output. Which is consequently why I can't do this:
print "Item $item_number is formatted like $description\n", "Is this okay? (Y/N): "; my $ok_description = <STDIN>; chomp($ok_description)l ok($ok_description =~ /^Y/, 'Description looks okay');
So far the best advice I could find was that Test::More does in fact swallow up all STDOUT, and that if I wanted it to work this way, I could try using STDERR, but that seems like it could easily lead to its own problems down the line.

Anyone have any advice on how to proceed? Or does this sound like something Test::More won't be able to handle?


In reply to Interactive Tests by starX

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.