projects
/
gitmo/Moose.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Make sure that Int rejects "1\n" and "\n1" (but Num does accept it)
[gitmo/Moose.git]
/
lib
/
Moose
/
Util
/
TypeConstraints
/
Builtins.pm
diff --git
a/lib/Moose/Util/TypeConstraints/Builtins.pm
b/lib/Moose/Util/TypeConstraints/Builtins.pm
index
e232e5d
..
485ae05
100644
(file)
--- a/
lib/Moose/Util/TypeConstraints/Builtins.pm
+++ b/
lib/Moose/Util/TypeConstraints/Builtins.pm
@@
-65,7
+65,7
@@
sub define_builtins {
subtype 'Int'
=> as 'Num'
- => where { "$_" =~ /^-?[0-9]+$/ }
+ => where { "$_" =~ /\A-?[0-9]+\z/ }
=> inline_as {
return ( qq{defined $_[1]}
. qq{&& ! ref $_[1]}