Boundary tests
- Example: Weird dates. Leap years, daylight savings time, 2000, 2038...
is( sqrt 0, 0, 'sqrt() of 0' );
is( eval q{ sqrt -1 }, undef );
like( $@, qr/^Can't take sqrt of -1 at/ );
is( eval { hack_intarweb() }, undef, 'hack_intarweb() no IP' );
is( $@, 'J00 f0rG0t tH3 iP aDdR3Ss lUs3r!11!11!!!', ' error msg' );
open(WORDS, "/usr/dict/words" ) || die $!;
my @stuff = <WORDS>;
my $num_stuff = count_stuff();
insert_stuff(@stuff);
is( count_stuff(), $num_stuff + @stuff,
'inserting lots of stuff' );
- Input that revealed a bug
# libscan() was correctly ignoring RCS directories but
# incorrectly ignoring any file matching /RCS/
is ($t->libscan('foo/RCS/bar'), '', 'libscan vs RCS');
is ($t->libscan('foo/RCS.pm'), 'foo/RCS.pm', 'libscan vs RCS.pm');
Prev | toc | Next