in reply to Counting test cases

I usually group together blocks of tests:
{ BEGIN { $static_tests += 3 } pass 'Group test 1/3'; pass 'Group test 2/3'; pass 'Group test 3/3'; }
It has several advantages, one of them is that I have to count only a small number of tests.
Another advantage is that now you can use the same variable names in each block without the risk of interference between them.

Replies are listed 'Best First'.
Re^2: Counting test cases
by kyle (Abbot) on Mar 30, 2008 at 18:28 UTC

    I do that too when I'm testing. I didn't do that in my OP because it didn't seem relevant to the topic. I actually put the counter block outside the group, though.

    BEGIN { $static_tests += 3 } { pass 'Group test 1/3'; pass 'Group test 2/3'; pass 'Group test 3/3'; }

    I'm not sure if I like that better, but the reasoning behind it was that the block is operating on a variable outside the group, so it should be outside the group. If it's in the group, it might look like it's less relevant to the stuff going on outside, which is not the case.