my $desc; sub TEST { $desc = $_[0] }; TEST "can't slurp in void context"; # your test here ok 1, $desc; #### use strict; use warnings; #comment before releasing use Perl6::Say; use Time::TimeTick; # TEST : # my function for displaying information about each test, # in a Test::Class Test subroutine with several tests my $desc; sub TEST { my $test_name = $_[0]; my $caller_func = (caller(1))[3]; # the subroutine full name my $test_group = (split('::', $caller_func))[-1]; # only the subroutine name $test_group =~ s/_/ /g; # replace underscores by spaces $desc = "$test_group $test_name"; }; use base qw(Test::Class); use Test::More 0.98; __PACKAGE__->runtests unless caller; sub A_Fruit__On_a_branch : Tests(3) { TEST "Grows"; ok 1, $desc; TEST "Can rot"; ok 1, $desc; TEST "Can fall"; ok 1, $desc; }; sub A_Fruit__On_the_floor__Rots : Test { ok 1; } done_testing(); 1; #### 1..4 ok 1 - A Fruit On a branch Grows ok 2 - A Fruit On a branch Can rot ok 3 - A Fruit On a branch Can fall ok 4 - A Fruit On the floor Rots