develooper Front page | perl.module-authors | Postings from May 2004

too many tests?

Thread Previous | Thread Next
From:
Jose Alves de Castro
Date:
May 5, 2004 04:20
Subject:
too many tests?
Message ID:
1083755759.3811.57.camel@localhost.telbit.pt
Yesterday, just for fun, I coded a module to convert between arabic and
roman numbers (I know there are quite a few, but hey, it was just for
fun).

Once I was done, I couldn't contend myself and I coded a function to
validate if a roman number is indeed a roman number... I did that with a
regex.

Now... wanting to test that function, I did some (1) tests like:

is(validate_roman('XVII'),1);
is(validate_roman('CXXIII'),1);

But I just couldn't stop there... I had to test things like:

isnt(validate_roman('LL'),1);

So what I did was generate all possibles combinations of qw(M D C L X V
I) up to 6 chars, remove the good ones and test them up...

This works fine up to 5 char combinations... but when you get to the
over 900.000 tests for the 6 char ones... argh ;-\

My computer simply froze (2)... and a message stating something like
"Enormous test number seen" kept displaying.

So... is this normal? How would you normally test this kind of thing?


Regards,

jac

(1) - Actually, not just "some"... I tested everything from 1 to 5000
:-|

(2) - I managed to do those tests by separating them in different files 


-- 
José Alves de Castro <jcastro@telbit.pt>
Telbit - Tecnologias de Informação


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About