Perl - Testing

perl

http://www.oreillynet.com/onlamp/blog/2005/08/why_use_perl_for_software_test.html

Devel::Cover;
Test::Unit;
perlUnit

package FooBar;
use base qw(Test::Unit::TestCase);
sub new {
    my $self = shift()->SUPER::new(@_);
    # your state or fixture goes here
    return $self;
}
sub set_up {
    # fixture
}
sub tear_down {
    # code to clean up after test
}
sub test_foo {
    my $self = shift;
    my $obj = ClassUnderTest->new(...);
    $self->assert_not_null($obj);
    $self->assert_equals('expected',$obj->foo);
}

TestRunner.pl My::TestCase::Class

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License