Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t] merge passig-arrays-to-functions.t into passing-arrays.t

git-svn-id: http://svn.pugscode.org/pugs@25922 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 681c0b6160b2536c77750003ddefd690dee2329f 1 parent 8cdbdfd
moritz authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 S06-signature/passing-arrays.t
12 S06-signature/passing-arrays.t
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 8;
+plan 9;
{
sub count(@a) {
@@ -39,3 +39,13 @@ plan 8;
sub t2(@a) { return t1(@a) };
is t2(@a), 8, 'can pass arrays through multiple subs';
}
+
+{
+ sub test_two_array(@a,@b)
+ {
+ return @a[0] + @b[0];
+ }
+
+ is(test_two_array([100,5],[20,300]), 120,
+ "Passing array references to functions accepting arrays works.");
+}
Please sign in to comment.
Something went wrong with that request. Please try again.