steal more tests from other modules
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / named_defaults.t
diff --git a/t/foreign/MooseX-Method-Signatures/named_defaults.t b/t/foreign/MooseX-Method-Signatures/named_defaults.t
new file mode 100644 (file)
index 0000000..b71de88
--- /dev/null
@@ -0,0 +1,20 @@
+#!perl
+use strict;
+use warnings FATAL => 'all';
+
+use Test::More;
+
+{
+    package Foo;
+
+    use Function::Parameters qw(:strict);
+
+       method new($class:) { bless {}, $class }
+    method bar (:$baz = 42) { $baz }
+}
+
+my $o = Foo->new;
+is($o->bar, 42);
+is($o->bar(baz => 0xaffe), 0xaffe);
+
+done_testing;