in reply to Writing unit test scripts for .pl scripts

Are you talking about testing, using something like Test::Simple or Test::More, or are you talking about Perl::Critic, which looks at the style of your code, compares it against Damian Conway's book Perl Best Practices and tells you when there's a disagreement in style?

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re: Writing unit test scripts for .pl scripts

Replies are listed 'Best First'.
Re^2: Writing unit test scripts for .pl scripts
by Anonymous Monk on May 04, 2008 at 13:10 UTC
    Yes, talking about testing the perl scripts using Test::Simple or Test::More.

      Ok then -- start writing tests. You'll need to set up either a test database, with the same schema as your Production database, or perhaps use something like DBD::Mock to provide canned responses for particular queries.

      Just go ahead and read the documentation on either of those Test module and come back with any questions you have. Good luck!

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        ...come back with any questions...
        I have one. :-)

        How do you test scripts (i.e. not a module)? The OP may not be able or want to change the scripts. The scripts may or may not be interactive, they may or may not need arguments supplied etc.

        Any tips on where to start looking? Is there something like Test::Expect for non-interactive scripts?

        update: tried to straighten out the grammer