Make check() accept extra args
[gitmo/Mouse.git] / t / 001_mouse / 072_tc_extra_args.t
diff --git a/t/001_mouse/072_tc_extra_args.t b/t/001_mouse/072_tc_extra_args.t
new file mode 100644 (file)
index 0000000..b4dc0e9
--- /dev/null
@@ -0,0 +1,20 @@
+#!perl
+use strict;
+use Test::More tests => 2;
+use if 'Mouse' ne 'Mo' . 'use', 'Test::More', skip_all => 'Mouse only';
+use Mouse::Meta::TypeConstraint;
+
+my @args;
+my $tc = Mouse::Meta::TypeConstraint->new(
+    constraint => sub {
+        is_deeply \@args, \@_;
+    },
+);
+
+@args = qw(foo bar baz);
+$tc->check( @args );
+
+@args = (100, 200);
+$tc->check( @args );
+
+done_testing;