Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[spec] all tests in S04-statement-modifiers fudged for rakudo plus mi…

…nor changes

git-svn-id: http://svn.pugscode.org/pugs@22069 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 10b316566ec95cf7f3fab61079bd4dc290ecea96 1 parent 085546c
dr_df0 authored
17 S04-statement-modifiers/given.t
View
@@ -2,26 +2,37 @@ use v6;
use Test;
-plan 4;
+plan 5;
# L<S04/"Conditional statements"/Conditional statement modifiers work as in Perl 5>
# test the ``given'' statement modifier
{
- my $a = $_ given 2 * 3;
+ my $a = 0;
+ $a = $_ given 2 * 3;
+ is($a, 6, "post given");
+}
+
+# test the ``given'' statement modifier
+#?rakudo skip 'rakudo dies on assignment to uninitialized variable when modifier given used'
+{
+ my $a;
+ $a = $_ given 2 * 3;
is($a, 6, "post given");
}
{
+ my $a = '';
my $a = $_ given 'a';
is($a, 'a', "post given");
}
# L<S04/The C<for> statement/"given" "use a private instance of" $_>
{
- my $i;
+ my $i = 0;
$_ = 10;
$i += $_ given $_+3;
+ #?rakudo todo 'outer $_ should not get updated in given modifier'
is $_, 10, 'outer $_ did not get updated in lhs of given';
is $i, 13, 'postfix given worked';
}
2  S04-statement-modifiers/if.t
View
@@ -35,7 +35,7 @@ plan 6;
is $x, 43, "?? || sanity check";
}
-#?rakudo skip "return if ... in sub does not work"
+#?rakudo skip "rakudo dies on 'return if <expr>' inside sub()"
{
sub foo() {
return if 1;
13 S04-statement-modifiers/until.t
View
@@ -2,13 +2,22 @@ use v6;
use Test;
-plan 3;
+plan 4;
# L<S04/"Conditional statements"/Conditional statement modifiers work as in Perl 5>
+# test simple the ``until'' statement modifier
+{
+ my $a=0;
+ $a += 1 until $a >= 10;
+ is($a, 10, "post until");
+}
+
# test the ``until'' statement modifier
+#?rakudo skip 'rakudo enters into infinite loop'
{
my ($a, $b);
+ $a=0; $b=0;
$a += $b += 1 until $b >= 10;
is($a, 55, "post until");
}
@@ -22,7 +31,7 @@ plan 3;
{
my @a = 'a'..'e';
- my $a;
+ my $a = 0;
$a ++ until shift(@a) eq 'c';
is($a, 2, "post until");
}
2  S04-statement-modifiers/while.t
View
@@ -22,7 +22,7 @@ plan 5;
}
# test the ``while'' statement modifier
-#?rakudo skip '$x += $y += 1 while $y < NN does not end'
+#?rakudo skip '$x += $y += 1 while $y < NN enters info infinite loop'
{
my $a = 0;
my $b = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.