Test::Class simple example
-
Test::Class
-
use the Test attribute to mark a function as test
package t::lib::MyApp;
use strict;
use warnings;
use base 'Test::Class';
use Test::More;
use MyApp qw(add);
sub test_add : Test {
is add(2, 3), 5;
}
1;
use strict;
use warnings;
use lib '.';
use t::lib::MyApp;
Test::Class->runtests;