Permalink
Browse files

one more test for multiple return

  • Loading branch information...
1 parent 9d2eebd commit 03a193a4350119a7007c8fd756260e94eb776a02 @NotFound committed Oct 5, 2011
Showing with 11 additions and 2 deletions.
  1. +11 −2 t/advanced/05mreturn.t
View
@@ -2,11 +2,11 @@
// Test return with multiple values
-using extern Test.More plan, is;
+using extern Test.More plan, is, ok;
function main()
{
- plan(5);
+ plan(6);
:(int i, int j) = ret2();
is(i, 42, "first value of 2");
@@ -18,6 +18,9 @@ function main()
:(i, j[optional], has2[opt_flag]) = ret2();
is(has2, 1, "optional used");
+
+ :(var v1, var v2, var v3) = retvars();
+ ok(v1 == null && v2 != null && v3 == null, "null/non null vars");
}
function ret1()
@@ -30,4 +33,10 @@ function ret2()
return 42, 24;
}
+function retvars()
+{
+ var v = 1;
+ return null, v, null;
+}
+
// End

0 comments on commit 03a193a

Please sign in to comment.