Created
May 11, 2010 09:12
-
-
Save snarkyboojum/397105 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use Test; | |
plan *; | |
use Tardis; | |
use Yapsi; | |
my Yapsi::Compiler $c .= new; | |
my Tardis::Debugger $d .= new; | |
my @programs-ticks = | |
'', 0, 'empty program', | |
'my $a', 1, 'uninitialised variable', | |
'my $a = 42', 2, 'initalised variable', | |
'my $a = 42; ++$a', 3, 'pre-increment', | |
'my $a = 42; my $b; { $b = 5 }', 3, 'immediate blocks', | |
'my $a = 42; { my $b = 5 }', 4, 'variable initialisation in immediate blocks', | |
'{}; my $a = 42; { my $b = 5 };', 4, 'multiple immediate blocks', | |
; | |
for @programs-ticks -> $program, $ticks, $message { | |
my @sic = $c.compile($program); | |
$d.run(@sic); | |
is +$d.ticks, $ticks, $message; | |
} | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment