Clarify the status of bundled external perl modules
[openssl.git] / external / perl / Text-Template-1.46 / t / 03-out.t
1 #!perl
2 #
3 # test apparatus for Text::Template module
4 # still incomplete.
5 #
6
7 use Text::Template;
8
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
12 Aborting"
13   unless $Text::Template::VERSION == 1.46;
14
15 print "1..1\n";
16
17 $n=1;
18
19 $template = q{
20 This line should have a 3: {1+2}
21
22 This line should have several numbers:
23 { $t = ''; foreach $n (1 .. 20) { $t .= $n . ' ' } $t }
24 };
25
26 $templateOUT = q{
27 This line should have a 3: { $OUT = 1+2 }
28
29 This line should have several numbers:
30 { foreach $n (1 .. 20) { $OUT .= $n . ' ' } }
31 };
32
33 # Build templates from string
34 $template = new Text::Template ('type' => 'STRING', 'source' => $template)
35   or die;
36 $templateOUT = new Text::Template ('type' => 'STRING', 'source' => $templateOUT)
37   or die;
38
39 # Fill in templates
40 $text = $template->fill_in()
41   or die;
42 $textOUT = $templateOUT->fill_in()
43   or die;
44
45 # (1) They should be the same
46 print +($text eq $textOUT ? '' : 'not '), "ok $n\n";
47 $n++;
48
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.
53
54
55 exit;
56