3 # test apparatus for Text::Template module
9 die "This is the test program for Text::Template version 1.46
10 You are using version $Text::Template::VERSION instead.
11 That does not make sense.\n
13 unless $Text::Template::VERSION == 1.46;
20 This line should have a 3: {1+2}
22 This line should have several numbers:
23 { $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
27 This line should have a 3: { $OUT = 1+2 }
29 This line should have several numbers:
30 { foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
33 # Build templates from string
34 $template = new Text::Template ('type' => 'STRING', 'source' => $template)
36 $templateOUT = new Text::Template ('type' => 'STRING', 'source' => $templateOUT)
40 $text = $template->fill_in()
42 $textOUT = $templateOUT->fill_in()
45 # (1) They should be the same
46 print +($text eq $textOUT ? '' : 'not '), "ok $n\n";
49 # Missing: Test this feature in Safe compartments;
50 # it's a totally different code path.
51 # Decision: Put that into safe.t, because that file should
52 # be skipped when Safe.pm is unavailable.