root/Date-Range-Birth/trunk/t/02_fail.t

Revision 368 (checked in by miyagawa, 18 years ago)

0.02

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use Test::More 'no_plan';
3
4 use Date::Simple;
5 use Date::Range::Birth;
6
7 my @fail = (
8     24, '2001-00-00', qr/date should be given/,
9     'foo', undef, qr/invalid argument/,
10     [ 24, 25, 26 ], undef, qr/invalid number/,
11 );
12
13 while (my($age, $date, $ex) = splice(@fail, 0, 3)) {
14     eval {
15         my $range = Date::Range::Birth->new($age, $date);
16     };
17     like $@, $ex, $@;
18 }
19
Note: See TracBrowser for help on using the browser.