3 # test apparatus for Text::Template module
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
12 unless $Text::Template::VERSION == 1.46;
17 # (1-2) Missing source
19 Text::Template->new();
21 unless ($@ =~ /^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/) {
29 Text::Template->new(TYPE => 'FILE');
31 if ($@ =~ /^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/) {
41 Text::Template->new(TYPE => 'wlunch', SOURCE => 'fish food');
43 if ($@ =~ /^\QIllegal value `WLUNCH' for TYPE parameter/) {
51 # (4-5) File does not exist
52 my $o = Text::Template->new(TYPE => 'file',
53 SOURCE => 'this file does not exist');
54 print $o ? "not ok $n\n" : "ok $n\n";
56 print defined($Text::Template::ERROR)
57 && $Text::Template::ERROR =~ /^Couldn't open file/
58 ? "ok $n\n" : "not ok $n\n";