Does anyone know of a good Perl unit test generator?

Does anyone know of a good Perl unit test generator?

  • Does anyone know of a good Perl unit test generator?

  • Answer:

    Not sure what you're asking, but most people write tests with http://search.cpan.org/perldoc?Test::More or http://search.cpan.org/perldoc?Test::Class. You then run these tests with the prove command included with Perl (actually, with Test::Harness). Example test: # foo.t use strict; use warnings; use Test::More tests => 1; ok( 1 == 1, 'is one one?' ); Running this: $ prove foo.t foo....ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.05 CPU) Result: PASS

Neer at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

EDIT: (Thanks to commentors) My original suggestion of PerlUnit is deprecated. Use http://search.cpan.org/perldoc?Test::Class instead. Original Post: You could try http://perlunit.sourceforge.net/. There is also a book chapter on unit testing in Perl: http://www.extremeperl.org/bk/unit-testing

Colin

If you're going to test web apps, http://seleniumhq.com allows you to do stuff in firefox and have it automatically be recorded as an equivalent set of Perl (or other language) tests. While it doesn't test everything, it is good for testing the user experience.

ysth

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.