Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

….named, etc.
  • Loading branch information...
commit 7a77ff860bcd574f23938f71c91f3a798a5b7bbe 1 parent baf17a4
Patrick R. Michaud pmichaud authored

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. +10 1 S06-signature/introspection.t
11 S06-signature/introspection.t
... ... @@ -1,6 +1,6 @@
1 1 use v6;
2 2 use Test;
3   -plan 48;
  3 +plan 52;
4 4
5 5 # L<S06/Signature Introspection>
6 6
@@ -128,6 +128,15 @@ sub j(*@i) {
128 128 ok &foo.signature.perl ~~ / ':' /, '.perl of a signature with anonymous named parameter';
129 129 }
130 130
  131 +# Capture param introspection
  132 +{
  133 + sub xyz(|$c) {};
  134 + is &xyz.signature.params[0].name, '$c' , '.name of |$c is "$c"';
  135 + is &xyz.signature.params[0].positional, False, '.positional on Capture param is False';
  136 + is &xyz.signature.params[0].capture, True , '.capture on Capture param is True';
  137 + is &xyz.signature.params[0].named, False, '.named on Capture param is True';
  138 +}
  139 +
131 140 done;
132 141
133 142 # vim: ft=perl6

0 comments on commit 7a77ff8

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