From: Dave Rolsky Date: Wed, 31 Aug 2011 15:08:57 +0000 (-0500) Subject: Add more tests, including tests that 0 is not negative or positive X-Git-Tag: 0.001003~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types-Common.git;a=commitdiff_plain;h=0cedb3109f3beaec890d3a9dc2d32ab9e03f137f Add more tests, including tests that 0 is not negative or positive --- diff --git a/t/02-numeric.t b/t/02-numeric.t index 06da831..aed9aa7 100644 --- a/t/02-numeric.t +++ b/t/02-numeric.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 18; use Test::Exception; { @@ -24,14 +24,20 @@ my $ins = FooTest->new; dies_ok { $ins->digit(100); } 'SingleDigit'; lives_ok { $ins->digit(1); } 'SingleDigit 2'; -dies_ok { $ins->posint(-100); } 'PositiveInt'; -dies_ok { $ins->posint(100.885); } 'PositiveInt 2'; -lives_ok { $ins->posint(100); } 'PositiveInt 3'; -lives_ok { $ins->posnum(100.885); } 'PositiveNum'; -dies_ok { $ins->posnum(-100.885); } 'PositiveNum 2'; +dies_ok { $ins->posint(-100); } 'PositiveInt (-100)'; +dies_ok { $ins->posint(0); } 'PositiveInt (0)'; +dies_ok { $ins->posint(100.885); } 'PositiveInt (100.885)'; +lives_ok { $ins->posint(100); } 'PositiveInt (100)'; +dies_ok { $ins->posnum(0); } 'PositiveNum (0)'; +lives_ok { $ins->posnum(100.885); } 'PositiveNum (100.885)'; +dies_ok { $ins->posnum(-100.885); } 'PositiveNum (-100.885)'; +lives_ok { $ins->posnum(0.0000000001); } 'PositiveNum (0.0000000001)'; -dies_ok { $ins->negint(100); } 'NegativeInt'; -dies_ok { $ins->negint(-100.885); } 'NegativeInt 2'; -lives_ok { $ins->negint(-100); } 'NegativeInt 3'; -lives_ok { $ins->negnum(-100.885); } 'NegativeNum'; -dies_ok { $ins->negnum(100.885); } 'NegativeNum 2'; +dies_ok { $ins->negint(100); } 'NegativeInt (100)'; +dies_ok { $ins->negint(-100.885); } 'NegativeInt (-100.885)'; +lives_ok { $ins->negint(-100); } 'NegativeInt (-100)'; +dies_ok { $ins->negint(0); } 'NegativeInt (0)'; +lives_ok { $ins->negnum(-100.885); } 'NegativeNum (-100.885)'; +dies_ok { $ins->negnum(100.885); } 'NegativeNum (100.885)'; +dies_ok { $ins->negnum(0); } 'NegativeNum (0)'; +lives_ok { $ins->negnum(-0.0000000001); } 'NegativeNum (-0.0000000001)';