# from A. Pagaltzis
# on Sunday 04 March 2007 12:42 pm:
>* Eric Wilhelm <[EMAIL PROTECTED]> [2007-03-04 08:20]:
>> It's a substitute for
>>
>> use Test::More (0 ? 'no_plan' : (tests => 202));
>>
>> ... mostly because I don't like the number of parens in that.
>
>Uh?
>
>use Test::More 0 ? 'no_
* Eric Wilhelm <[EMAIL PROTECTED]> [2007-03-04 08:20]:
> It's a substitute for
>
> use Test::More (0 ? (no_plan) : (tests => 202));
>
> ... mostly because I don't like the number of parens in that.
Uh?
use Test::More 0 ? 'no_plan' : ( tests => 202 );
--
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/p
On Mar 4, 2007, at 6:33 AM, Dominique Quatravaux wrote:
And what if you are running a variable number of tests depending on
stuff such as compile-time options, maintainer mode enabled or not, or
whatever?
It's really not that hard. It's OK to declare a plan at runtime as
long as you declare
Dominique Quatravaux wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Andy Lester wrote:
Good Lord do I get frustrated at the handwringing over test
counting. Look, it's simple. You write your tests. You run it
through prove. You see how many tests it reports. You add it at
the top of
# from brian d foy
# on Sunday 04 March 2007 10:02 am:
>I run into problems where a loop runs fewer iterations than it should
>but the test script otherwise runs to completion normally.
I typically treat that as a test case.
my $counter = 0;
for(things(@foos)) {
ok($_);
$counter++;
# from Sébastien Aperghis-Tramoni
# on Sunday 04 March 2007 06:19 am:
> use Test::More;
>
> my $tests;
> plan tests => $tests;
>
> BEGIN { $tests += n }
> # paragraph of code with n tests
>
> BEGIN { $tests += m }
> # paragraph of code with m tests
Interesting. What i
# from Dominique Quatravaux
# on Sunday 04 March 2007 04:33 am:
>And what if you are running a variable number of tests depending on
>stuff such as compile-time options, maintainer mode enabled or not, or
>whatever?
Even under no_plan, I would say you should use skip() there.
--Eric
--
"Time fl
In article <[EMAIL PROTECTED]>, Eric Wilhelm
<[EMAIL PROTECTED]> wrote:
> At the bottom of a test file:
>
> {my $finish = 1; END {$finish or die "\n unplanned exit"}};
>
> Yeah, you have to remember to put it at the end of the file, but it may
> be easier than counting tests. Thoughts?
Yo
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Andy Lester wrote:
> Good Lord do I get frustrated at the handwringing over test
> counting. Look, it's simple. You write your tests. You run it
> through prove. You see how many tests it reports. You add it at
> the top of the file. Voila!
And
In article <[EMAIL PROTECTED]>, Ricardo
SIGNES <[EMAIL PROTECTED]> wrote:
> * brian d foy <[EMAIL PROTECTED]> [2007-03-03T13:31:15]
> > In article <[EMAIL PROTECTED]>, Ricardo
> > SIGNES <[EMAIL PROTECTED]> wrote:
> > > extensions:
> > > CPAN::Reporter:
> > > cc_author: 0
> >
> > I th
David Golden wrote:
More often, I find myself creating some data structure to define test
cases and then:
plan tests => $fixed + $tests_per_case * @cases;
Once I've defined the basic tests, I'm usually adding cases rather
than changing the per-case test count, so the total test count takes
ca
On Sunday 04 March 2007 09:40, Shlomi Fish wrote:
My solution to this is:
Of late, one solution I've used is just Ctrl-A and Ctrl-X in Vim, with
some shortcuts:
map ,at m` :silent /plan tests =>3w,/``
map ,rt m` :silent /plan tests =>3w,/``
This works well enough for simple test files.
On Sunday 04 March 2007 09:40, Shlomi Fish wrote:
> My solution to this is:
>...
> What I do is add comments in a small domain-specific language ...
>...
> # TEST
> is ($mystring, "Hello", "String is Hello");
>
> # TEST*3
> for my $i (0 .. 2)
> {
> ok ()
> }
>
Wouldn't Test::Block be bet
On 2 Mar 2007, at 22:53, James E Keenan wrote:
Adrian Howard wrote:
[snip]
Adrian: How about posting this part on http://perl-qa.yi.org/
index.php/Main_Page?
[snip]
ObItsAWiki :-)
Adrian
On 4 Mar 2007, at 03:40, Matisse Enzer wrote:
A tangential comment:
The xUnit approach avoids this question of "counting" altogether -
you create one or more subroutines whose names begin with 'test',
each of which contain one or more assertions such as is_deeply($got,
$expected); and th
On Sunday 04 March 2007, chromatic wrote:
> On Saturday 03 March 2007 18:18, Andy Lester wrote:
> > Good Lord do I get frustrated at the handwringing over test
> > counting. Look, it's simple. You write your tests. You run it
> > through prove. You see how many tests it reports. You add it
16 matches
Mail list logo