6.12. My own test functionsAfter writing lots of tests, you'll start to re-factor your code and create functions for specific parts of the test: You will have some code like this: use Test::More tests => 2;
is(my_test(2, '+', 3), 5);
is(my_test(4, '+', 4), 10);
sub my_test {
my ($x, $op, $z) = @_;
# do stuff
return $result;
}
|
Follow me: