Skip to content

Commit

Permalink
[t] whitespace therapy
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed Sep 1, 2010
1 parent 5f23b48 commit 6baad9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions t/compiler.t
Expand Up @@ -64,8 +64,8 @@ my @programs-that-don't-compile = # '
'if $a {}',
'if 42 { $a }',
'if 5 {} else { $a }',
'unless {} ',
'unless a {} ',
'unless {}',
'unless a {}',
;

for @programs-that-don't-compile -> $program { # '
Expand Down
12 changes: 7 additions & 5 deletions t/runtime.t
Expand Up @@ -25,7 +25,8 @@ my @tests =
'my $a = 42; { say $a }', "42\n", 'variable in a block',
'my $a = 42; { say my $a }', "Any()\n", 'new variable in a block',
'my $a; { $a = 42 }; say $a', "42\n", 'value survives block',
'my $a = 42; {my $a = 7}; say $a', "42\n", 'initialised value survives block',
'my $a = 42; {my $a = 7}; say $a', "42\n",
'initialised value survives block',
'{}; my $a = 42; { say $a }', "42\n", 'same-level blocks',
'if 42 { say 5 }', "5\n", 'executing if block',
'if 0 { say 5 }', "", 'non-executing if block',
Expand All @@ -34,10 +35,11 @@ my @tests =
'my $a = 4; while --$a { say $a }',
"3\n2\n1\n", 'while loop',
'my $a; while $a { say 42 }', "", 'non-executing while loop',
'my $a = 42;unless $a { say 24 }', "", 'non-executing unless block',
'unless 0 { say 42 }', "42\n", 'executing unless block',
'my $a=0; until $a { say 42; ++$a; }',"42\n", 'executing until loop structure',
'until 42 { say 24; }' , "", 'non-executing until loop structure',
'my $a = 42;unless $a { say 24 }', "", 'non-executing unless',
'unless 0 { say 42 }', "42\n", 'executing unless',
'my $a=0; until $a { say 42; ++$a; }',
"42\n", 'until loop',
'until 42 { say 24; }', "", '0-itertion until loop',
'my $a = 3; while --$a { say my $b; $b = 42 }', "Any()\nAny()\n",
'each time a block is entered, it gets a fresh lexical pad',
'my $a = 42; { { say $a; } }', "42\n", 'var lookup >1 block up',
Expand Down

0 comments on commit 6baad9f

Please sign in to comment.