Zero is not negative or positive
Dave Rolsky [Wed, 31 Aug 2011 15:09:12 +0000 (10:09 -0500)]
lib/MooseX/Types/Common/Numeric.pm

index 7744cfc..af9e01a 100644 (file)
@@ -13,48 +13,48 @@ use MooseX::Types::Moose qw/Num Int/;
 
 subtype PositiveNum,
   as Num,
-  where { $_ >= 0 },
+  where { $_ > 0 },
   message { "Must be a positive number" },
     ( $Moose::VERSION >= 2.0200
         ? inline_as {
             $_[0]->parent()->_inline_check( $_[1] ) . ' && '
-                . qq{ ($_[1] >= 0) };
+                . qq{ ($_[1] > 0) };
         }
         : ()
     );
 
 subtype PositiveInt,
   as Int,
-  where { $_ >= 0 },
+  where { $_ > 0 },
   message { "Must be a positive integer" },
     ( $Moose::VERSION >= 2.0200
         ? inline_as {
             $_[0]->parent()->_inline_check( $_[1] ) . ' && '
-                . qq{ ($_[1] >= 0) };
+                . qq{ ($_[1] > 0) };
         }
         : ()
     );
 
 subtype NegativeNum,
   as Num,
-  where { $_ <= 0 },
+  where { $_ < 0 },
   message { "Must be a negative number" },
     ( $Moose::VERSION >= 2.0200
         ? inline_as {
             $_[0]->parent()->_inline_check( $_[1] ) . ' && '
-                . qq{ ($_[1] <= 0) };
+                . qq{ ($_[1] < 0) };
         }
         : ()
     );
 
 subtype NegativeInt,
   as Int,
-  where { $_ <= 0 },
+  where { $_ < 0 },
   message { "Must be a negative integer" },
     ( $Moose::VERSION >= 2.0200
         ? inline_as {
             $_[0]->parent()->_inline_check( $_[1] ) . ' && '
-                . qq{ ($_[1] <= 0) };
+                . qq{ ($_[1] < 0) };
         }
         : ()
     );