use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 6;
BEGIN {
use_ok('MooseX::Getopt');
is_deeply($app->nums, [3, 5], '... nums is [3, 5] as expected');
}
+# Make sure it really used our =i@, instead of falling back
+# to =s@ via the type system, and test that exceptions work
+# while we're at it.
+eval {
+ local @ARGV = ('--nums', 3, '--nums', 'foo');
+
+ my $app = App->new_with_options;
+};
+like($@, qr/Value "foo" invalid/, 'Numeric constraint enforced');