Skip to content
Browse files

[S06]: Add tests for capture parameter introspection of .positional, …

….named, etc.
  • Loading branch information...
1 parent baf17a4 commit 7a77ff860bcd574f23938f71c91f3a798a5b7bbe @pmichaud pmichaud committed Jul 7, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 S06-signature/introspection.t
View
11 S06-signature/introspection.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 48;
+plan 52;
# L<S06/Signature Introspection>
@@ -128,6 +128,15 @@ sub j(*@i) {
ok &foo.signature.perl ~~ / ':' /, '.perl of a signature with anonymous named parameter';
}
+# Capture param introspection
+{
+ sub xyz(|$c) {};
+ is &xyz.signature.params[0].name, '$c' , '.name of |$c is "$c"';
+ is &xyz.signature.params[0].positional, False, '.positional on Capture param is False';
+ is &xyz.signature.params[0].capture, True , '.capture on Capture param is True';
+ is &xyz.signature.params[0].named, False, '.named on Capture param is True';
+}
+
done;
# vim: ft=perl6

0 comments on commit 7a77ff8

Please sign in to comment.
Something went wrong with that request. Please try again.