Debian Codegraph @

t/040_tterse/021_fake_use.t

raw symbols SCIP
1 #!perl -w
2 use strictscip-perl cpan Text-Xslate v3.5.9 strict/;
3 use Test::Requiresscip-perl cpan Text-Xslate v3.5.9 Test/Requires/ qw(Template::Plugin::Math);
4 use Test::Morescip-perl cpan Text-Xslate v3.5.9 Test/More/;
5
6 use libscip-perl cpan Text-Xslate v3.5.9 lib/ "t/lib";
7 use TTSimplescip-perl cpan Text-Xslate v3.5.9 TTSimple/;
8
9 use Template::Plugin::Stringscip-perl cpan Text-Xslate v3.5.9 Template/Plugin/String/;
10
11 # XXX: TTerse does not support plugins (i.e. USE directive), but grokes
12 # the USE keyword as an alias to 'CALL', which takes expressions.
13
14 my @data = (
15 [<<'T', <<'X'],
16 [% USE Math -%]
17 [% Math.abs(-100) %]
18 [% Math.abs( 100) %]
19 T
20 100
21 100
22 X
23
24 [<<'T', <<'X'],
25 [% USE String -%]
26 [% s = String.new("foo") -%]
27 [% s.upper %]
28 [% s.repeat(2) %]
29 T
30 FOO
31 FOOFOO
32 X
33
34 );
35
36 my %vars = (
37 lang => 'Xslate',
38 void => '',
39
40 value => 10,
41
42 Math => Template::Plugin::Math->newscip-perl cpan Text-Xslate v3.5.9 Template/Plugin/Math/new().(), # as a namespace
43 String => Template::Plugin::String->newscip-perl cpan Text-Xslate v3.5.9 Template/Plugin/String/new().(), # as a prototype
44 );
45 foreach my $d(@data) {
46 my($in, $out, $msg) = @$d;
47 isscip-perl cpan Text-Xslate v3.5.9 main/is(). render_strscip-perl cpan Text-Xslate v3.5.9 main/render_str().($in, \%vars), $out, $msg or diagscip-perl cpan Text-Xslate v3.5.9 main/diag().($in);
48 }
49
50 done_testing;