Parse and store javadoc-style docstrings at toplevel
[kaos.git] / t / 05inline.t
blobbd2e5e5033f069905ea7615de1d215ec5d451ec2
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 use Test::Kaos;
6 plan tests => 6;
8 test_output("Inline - same scope", q{
9 numeric foo;
10 _caos { .inline let $foo = FOO; }
11 print(foo);
12 }, q{
13 OUTV FOO
14 });
16 test_output("Inline - different scope, within statement", q{
17 define foo() returning numeric {
18 _caos { .inline let $return = FOO; }
20 install {
21 print(foo());
23 }, q{
24 OUTV FOO
25 });
27 test_output("Inline - different scope, cross statement", q{
28 define foo() returning numeric {
29 _caos { .inline let $return = FOO; }
31 install {
32 numeric bar = foo();
33 print(bar);
35 }, q{
36 SETV $1 FOO
37 OUTV $1
38 });
40 test_output("Static - same scope", q{
41 numeric foo;
42 _caos { .static let $foo = FOO; }
43 print(foo);
44 }, q{
45 OUTV FOO
46 });
48 test_output("Static - different scope, within statement", q{
49 define foo() returning numeric {
50 _caos { .static let $return = FOO; }
52 install {
53 print(foo());
55 }, q{
56 OUTV FOO
57 });
59 test_output("Static - different scope, cross statement", q{
60 define foo() returning numeric {
61 _caos { .static let $return = FOO; }
63 install {
64 numeric bar = foo();
65 print(bar);
67 }, q{
68 OUTV FOO
69 });