import some (modified) MXMS tests
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / too_many_args.t
diff --git a/t/foreign/MooseX-Method-Signatures/too_many_args.t b/t/foreign/MooseX-Method-Signatures/too_many_args.t
new file mode 100644 (file)
index 0000000..ed881d6
--- /dev/null
@@ -0,0 +1,19 @@
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Test::Fatal;
+
+{
+    package Foo;
+    use Function::Parameters qw(:strict);
+
+       method new($class:) { bless {}, $class }
+    method foo ($bar) { $bar }
+}
+
+my $o = Foo->new;
+is(exception { $o->foo(42) }, undef);
+like(exception { $o->foo(42, 23) }, qr/Too many arguments/);
+
+done_testing;