use v6;
use Test;
plan 6;
my $hist;
END {
is $hist, 'BCISE', 'interpolated END {...} executed';
}
ok "{ END { $hist ~= 'E' } }" ~~ undef,
'END {...} not yet executed';
is "{ START { $hist ~= 'S' } }", "BCIS",
'START {...} fired at run-time, entry time of the mainline code';
is "{ INIT { $hist ~= 'I' } }", 'BCI',
'INIT {...} fired at the beginning of runtime';
is "{ CHECK { $hist ~= 'C' } }", "BC",
'CHECK {...} fired at compile-time, ALAP';
is "{ BEGIN { $hist ~= 'B' } }", "B",
'BEGIN {...} fired at compile-time, ASAP';