Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (29 sloc) 1.067 kB
297e783 [t] and [t/spec]
moritz authored
1 use v6;
2
16da25b [t/spec] fix more smartlinks and comments
moritz authored
3 # Test phasers interpolated in double-quoted strings
297e783 [t] and [t/spec]
moritz authored
4
5 use Test;
6
7 plan 6;
8
9 # [TODO] add tests for ENTER/LEAVE/KEEP/UNDO/PRE/POST/etc
10
4e5f604 [t/spec] fix some smartlinks
moritz authored
11 # L<S04/Phasers/END "at run time" ALAP>
297e783 [t] and [t/spec]
moritz authored
12
13 # IRC log:
14 # ----------------------------------------------------------------
15 # agentzh question: should BEGIN blocks interpolated in double-quoted
16 # strings be fired at compile-time or run-time?
17 # for example, say "This is { BEGIN { say 'hi' } }";
18 # audreyt compile time.
19 # qq is not eval.
20
21 my $hist;
22
23 END {
24 is $hist, 'BCISE', 'interpolated END {...} executed';
25 }
26
28ef8dc @coke pugs fudges
coke authored
27 #?pugs todo
2544bcf @jdhore Remove most remaining .notdef's.
jdhore authored
28 nok "{ END { $hist ~= 'E' } }".defined,
297e783 [t] and [t/spec]
moritz authored
29 'END {...} not yet executed';
30
31 is "{ START { $hist ~= 'S' } }", "BCIS",
32 'START {...} fired at run-time, entry time of the mainline code';
33
34 is "{ INIT { $hist ~= 'I' } }", 'BCI',
35 'INIT {...} fired at the beginning of runtime';
36
37 is "{ CHECK { $hist ~= 'C' } }", "BC",
38 'CHECK {...} fired at compile-time, ALAP';
39
40 is "{ BEGIN { $hist ~= 'B' } }", "B",
41 'BEGIN {...} fired at compile-time, ASAP';
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
42
43 # vim: ft=perl6
Something went wrong with that request. Please try again.