Permalink
Browse files

[t/spec] some more variable declaration fixes

git-svn-id: http://svn.pugscode.org/pugs@25274 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent b87b639 commit e704067f3de6a088a1051dc0f22d805ca6657e65 moritz committed Feb 10, 2009
@@ -110,7 +110,7 @@ my $mp = POST_Child.new;
lives_ok { $mp.test(-42) }, "It's enough if we satisfy one of the POST blocks (Child)";
lives_ok { $mp.test(42) }, "It's enough if we satisfy one of the POST blocks (Parent)";
-dies_ok { $tmp.test(12) }, 'Violating poth POST blocks throws an error';
+dies_ok { $mp.test(12) }, 'Violating poth POST blocks throws an error';
class Another {
method test(Num $x) {
View
@@ -43,7 +43,7 @@ eval_dies_ok 'my $i; do { $i++ } given $i;',
=end comment
#?rakudo skip 'if returning undef'
{
- $x = do if 0 { 1 } elsif 0 { 2 };
+ my $x = do if 0 { 1 } elsif 0 { 2 };
ok !$x.defined, 'when if does not execute any branch, return undef';
}
View
@@ -10,10 +10,6 @@ version 0.3 (12 Apr 2004), file t/counted.t.
plan 178;
-if !eval('("a" ~~ /a/)') {
- skip_rest "skipped tests - rules support appears to be missing";
-} else {
-
# L<S05/Modifiers/If the number is followed by an>
my $data = "f fo foo fooo foooo fooooo foooooo";
@@ -165,31 +161,31 @@ my $try = $data;
ok(!( $try ~~ s:0th{fo+}=q{bar} ), "Can't substitute 0th" );
is($try, $data, 'No change to data for 0th');
-my $try = $data;
+$try = $data;
ok($try ~~ s:1st{fo+}=q{bar}, 'substitute 1st');
is($try, $sub1, 'substituted 1st correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:2nd{fo+}=q{bar}, 'substitute 2nd');
is($try, $sub2, 'substituted 2nd correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:3rd{fo+}=q{bar}, 'substitute 3rd');
is($try, $sub3, 'substituted 3rd correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:4th{fo+}=q{bar}, 'substitute 4th');
is($try, $sub4, 'substituted 4th correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:5th{fo+}=q{bar}, 'substitute 5th');
is($try, $sub5, 'substituted 5th correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:6th{fo+}=q{bar}, 'substitute 6th');
is($try, $sub6, 'substituted 6th correctly');
-my $try = $data;
+$try = $data;
ok(!( $try ~~ s:7th{fo+}=q{bar} ), "Can't substitute 7th" );
is($try, $data, 'No change to data for 7th');
@@ -277,31 +273,31 @@ my $try = $data;
ok(!( $try ~~ s:0x{fo+}=q{bar} ), "Can't substitute 0x" );
is($try, $data, 'No change to data for 0x');
-my $try = $data;
+$try = $data;
ok($try ~~ s:1x{fo+}=q{bar}, 'substitute 1x');
is($try, $sub1, 'substituted 1x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:2x{fo+}=q{bar}, 'substitute 2x');
is($try, $sub2, 'substituted 2x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:3x{fo+}=q{bar}, 'substitute 3x');
is($try, $sub3, 'substituted 3x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:4x{fo+}=q{bar}, 'substitute 4x');
is($try, $sub4, 'substituted 4x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:5x{fo+}=q{bar}, 'substitute 5x');
is($try, $sub5, 'substituted 5x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:6x{fo+}=q{bar}, 'substitute 6x');
is($try, $sub6, 'substituted 6x correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:7x{fo+}=q{bar}, 'substitute 7x');
is($try, $sub6, 'substituted 7x correctly');
@@ -316,33 +312,31 @@ my $gsub4 = "f fo foo fooo bar fooooo foooooo";
my $gsub5 = "f fo foo fooo foooo bar foooooo";
my $gsub6 = "f fo foo fooo foooo fooooo bar";
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:1st{fo+}=q{bar}, 'Global :1st match');
is($try, $gsub1, 'substituted :g:1st correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:2nd{fo+}=q{bar}, 'Global :2nd match');
is($try, $gsub2, 'substituted :g:2nd correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:3rd{fo+}=q{bar}, 'Global :3rd match');
is($try, $gsub3, 'substituted :g:3rd correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:4th{fo+}=q{bar}, 'Global :4th match');
is($try, $gsub4, 'substituted :g:4th correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:5th{fo+}=q{bar}, 'Global :5th match');
is($try, $gsub5, 'substituted :g:5th correctly');
-my $try = $data;
+$try = $data;
ok($try ~~ s:g:6th{fo+}=q{bar}, 'Global :6th match');
is($try, $gsub6, 'substituted :g:6th correctly');
-my $try = $data;
+$try = $data;
ok(!( $try ~~ s:g:7th{fo+}=q{bar} ), 'Global :7th match');
is($try, $data, 'substituted :g:7th correctly');
-}
-
@@ -49,16 +49,16 @@ my ($item_ctx, @list_ctx);
#?pugs todo 'feature'
{
- is try { $item_ctx = sm_ok_in_item() }, 42,
+ is try { my $item_ctx = sm_ok_in_item() }, 42,
"want() works correctly in Item context (smartmatch-form)";
- is try { @list_ctx = sm_ok_in_list() }, 42,
+ is try { my @list_ctx = sm_ok_in_list() }, 42,
"want() works correctly in List context (smartmatch-form)";
- is try { ($a, $b) = sm_ok_in_count2() }, 42,
+ is try { my ($a, $b) = sm_ok_in_count2() }, 42,
"want.count() works correct if two return values are expected (smartmatch-form)";
- is try { ($c,$d,$e) = sm_ok_in_count3() }, 42,
+ is try { my ($c,$d,$e) = sm_ok_in_count3() }, 42,
"want.count() works correct if three return values are expected (smartmatch-form)";
}
@@ -78,6 +78,6 @@ plan 20;
is($b, $point_b, 'unpacked TwoPoint object (2)');
my Point $ ($c, $d) := getpoints();
- is($c, $point_c, 'unpacked TwoPoint object (3)');
- is($d, $point_d, 'unpacked TwoPoint object (4)');
+ is($c, $point_a, 'unpacked TwoPoint object (3)');
+ is($d, $point_a, 'unpacked TwoPoint object (4)');
}

0 comments on commit e704067

Please sign in to comment.