]> WPIA git - cassiopeia.git/blob - lib/openssl/external/perl/Text-Template-1.46/t/06-ofh.t
upd: openssl to 1.1.0
[cassiopeia.git] / lib / openssl / external / perl / Text-Template-1.46 / t / 06-ofh.t
1 #!perl
2 #
3 # test apparatus for Text::Template module
4 # still incomplete.
5
6 use Text::Template;
7
8 die "This is the test program for Text::Template version 1.46.
9 You are using version $Text::Template::VERSION instead.
10 That does not make sense.\n
11 Aborting"
12   unless $Text::Template::VERSION == 1.46;
13
14 print "1..2\n";
15
16 $n=1;
17
18 $template = new Text::Template TYPE => STRING, SOURCE => q{My process ID is {$$}};
19 $of = "t$$";
20 END { unlink $of }
21 open O, "> $of" or die;
22
23 $text = $template->fill_in(OUTPUT => \*O);
24
25 # (1) No $text should have been constructed.  Return value should be true.
26 print +($text eq '1' ? '' : 'not '), "ok $n\n";
27 $n++;
28
29 close O or die;
30 open I, "< $of" or die;
31 { local $/; $t = <I> }
32 close I;
33
34 # (2) The text should have been printed to the file
35 print +($t eq "My process ID is $$" ? '' : 'not '), "ok $n\n";
36 $n++;
37
38 exit;
39