Skip to content
Browse files

[t/spec]: Add some tests for slurpy params and autothreading (RT #681…

…42).

git-svn-id: http://svn.pugscode.org/pugs@27858 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 8705dbf commit bb5a588bdce7aa42fda72b8c01082787cc9309eb pmichaud committed Aug 3, 2009
Showing with 30 additions and 1 deletion.
  1. +30 −1 S06-signature/slurpy-params.t
View
31 S06-signature/slurpy-params.t
@@ -3,7 +3,7 @@ use Test;
# L<S06/List parameters/Slurpy parameters>
-plan 59;
+plan 63;
sub xelems(*@args) { @args.elems }
sub xjoin(*@args) { @args.join('|') }
@@ -263,4 +263,33 @@ These tests are the testing for "List parameters" section of Synopsis 06
dies_ok { $y.x_slurp( 35 ) }, 'dies calling method with typed slurpy sig';
}
+{
+ my $count = 0;
+ sub slurp_obj_thread(*@a) { $count++; }
+ multi sub slurp_obj_multi(*@a) { $count++; }
+
+ $count = 0;
+ slurp_obj_thread(3|4|5);
+ is $count, 1, 'Object slurpy param doesnt autothread';
+ $count = 0;
+ slurp_obj_multi(3|4|5);
+ is $count, 1, 'Object slurpy param doesnt autothread';
+}
+
+#?rakudo skip 'Typed slurpy, junctions, and autothreading (RT 68142)'
+## Note: I've listed these as though they succeed, but it's possible
+## that the parameter binding should fail outright. --pmichaud
+{
+ sub slurp_any_thread(Any *@a) { $count++; }
+ multi sub slurp_any_multi(Any *@a) { $count++; }
+
+ $count = 0;
+ slurp_any_thread(3|4|5);
+ is $count, 1, 'Any slurpy param doesnt autothread';
+ $count = 0;
+ #?rakudo skip
+ slurp_any_multi(3|4|5);
+ is $count, 1, 'Any slurpy param doesnt autothread';
+}
+
# vim: ft=perl6

0 comments on commit bb5a588

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