3 # test apparatus for Text::Template module
9 use Test::More tests => 4;
11 use_ok 'Text::Template' or exit 1;
14 This line should have a 3: {1+2}
16 This line should have several numbers:
17 { $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
21 This line should have a 3: { $OUT = 1+2 }
23 This line should have several numbers:
24 { foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
27 # Build templates from string
28 my $template = Text::Template->new('type' => 'STRING', 'source' => $templateIN);
29 isa_ok $template, 'Text::Template';
31 $templateOUT = Text::Template->new('type' => 'STRING', 'source' => $templateOUT);
32 isa_ok $templateOUT, 'Text::Template';
35 my $text = $template->fill_in();
36 my $textOUT = $templateOUT->fill_in();
38 # (1) They should be the same
41 # Missing: Test this feature in Safe compartments;
42 # it's a totally different code path.
43 # Decision: Put that into safe.t, because that file should
44 # be skipped when Safe.pm is unavailable.