diff --git a/t/compiler.t b/t/compiler.t index 11f4654..12dd6db 100644 --- a/t/compiler.t +++ b/t/compiler.t @@ -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 { # ' diff --git a/t/runtime.t b/t/runtime.t index 5d01444..0b37b7c 100644 --- a/t/runtime.t +++ b/t/runtime.t @@ -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', @@ -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',