2 # test apparatus for Text::Template module
10 die "This is the test program for Text::Template version 1.46.
11 You are using version $Text::Template::VERSION instead.
12 That does not make sense.\n
14 unless $Text::Template::VERSION == 1.46;
16 # (1) basic error delivery
17 { my $r = Text::Template->new(TYPE => 'string',
20 if ($r eq q{Program fragment delivered error ``Illegal division by zero at template line 1.''}) {
23 print "not ok $n\n# $r\n";
28 # (2) BROKEN sub called in ->new?
29 { my $r = Text::Template->new(TYPE => 'string',
31 BROKEN => sub {'---'},
36 print "not ok $n\n# $r\n";
41 # (3) BROKEN sub called in ->fill_in?
42 { my $r = Text::Template->new(TYPE => 'string',
44 )->fill_in(BROKEN => sub {'---'});
48 print "not ok $n\n# $r\n";
53 # (4) BROKEN sub passed correct args when called in ->new?
54 { my $r = Text::Template->new(TYPE => 'string',
56 BROKEN => sub { my %a = @_;
57 qq{$a{lineno},$a{error},$a{text}}
60 if ($r eq qq{1,Illegal division by zero at template line 1.\n,1/0}) {
63 print "not ok $n\n# $r\n";
68 # (5) BROKEN sub passed correct args when called in ->fill_in?
69 { my $r = Text::Template->new(TYPE => 'string',
73 qq{$a{lineno},$a{error},$a{text}}
75 if ($r eq qq{1,Illegal division by zero at template line 1.\n,1/0}) {
78 print "not ok $n\n# $r\n";