Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (31 sloc) 1.069 kB
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
1 use v6;
2 use Test;
3
0cc228a [gsoc_spectest] added one more test in the area (added 1 test)
Auzon authored
4 plan 10;
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
5
6 # L<S06/Stub declarations>
7
9f47446 @lizmat s/lives_ok/lives-ok/g
lizmat authored
8 lives-ok({sub thunder {...}}, 'sub foo {...} works');
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
9
0cbc065 @lizmat s/eval_dies_ok/eval-dies-ok/g
lizmat authored
10 eval-dies-ok('sub foo;', 'old Perl 5 "sub foo;" syntax is dead');
0cc228a [gsoc_spectest] added one more test in the area (added 1 test)
Auzon authored
11
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
12 {
13 sub lightning {...}
14 # Maybe should be warns_ok
0cbc065 @lizmat s/eval_dies_ok/eval-dies-ok/g
lizmat authored
15 eval-dies-ok('lightning()', 'executing stub subroutine dies');
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
16 sub lightning {42}
17 is(lightning(), 42, 'redefining stub subroutine works without extra syntax');
18
19 sub hail {???}
20 # Should be warns_ok
9f47446 @lizmat s/lives_ok/lives-ok/g
lizmat authored
21 lives-ok({hail()}, 'executing stub subroutine lives (should warn here)');
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
22 sub hail {47}
23 is(hail(), 47, 'redefining stub subroutine works without extra syntax');
24
25 sub wind {!!!}
0cbc065 @lizmat s/eval_dies_ok/eval-dies-ok/g
lizmat authored
26 eval-dies-ok('wind()', 'executing stub subroutine dies');
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
27 sub wind {17}
28 is(wind(), 17, 'redefining stub subroutine works without extra syntax');
29
30 }
31
32 {
5b8dbb5 @lizmat "use MONKEY_TYPING" -> "use MONKEY-TYPING"
lizmat authored
33 use MONKEY-TYPING;
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
34 sub hail {26}
35 # Maybe should be warns_ok
0cbc065 @lizmat s/eval_dies_ok/eval-dies-ok/g
lizmat authored
36 eval-dies-ok('sub hail {10}', 'redefining existing subroutine dies');
7b1fea4 [stub.t] is instead should be supersede
lwall authored
37 supersede sub hail {8}
38 is(hail(), 8, 'redefining non-stub subroutine with supersede');
f5a237f [gsoc_spectest] added tests for stub subroutines in S06 (added 9 tests)
Auzon authored
39 }
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
40
41 # vim: ft=perl6
Something went wrong with that request. Please try again.