aboutsummaryrefslogtreecommitdiff
path: root/openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t
diff options
context:
space:
mode:
authorWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-04-30 00:33:56 +0200
committerWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-04-30 00:33:56 +0200
commitaa4d426b4d3527d7e166df1a05058c9a4a0f6683 (patch)
tree4ff17ce8b89a2321b9d0ed4bcfc37c447bcb6820 /openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t
downloadsmtps-and-pop3s-console-program-master.tar.gz
smtps-and-pop3s-console-program-master.zip
initial/final commitHEADmaster
Diffstat (limited to 'openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t')
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t82
1 files changed, 82 insertions, 0 deletions
diff --git a/openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t b/openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t
new file mode 100644
index 0000000..d362395
--- /dev/null
+++ b/openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t
@@ -0,0 +1,82 @@
+#!perl
+# test apparatus for Text::Template module
+
+use Text::Template;
+
+print "1..5\n";
+
+$n=1;
+
+die "This is the test program for Text::Template version 1.46.
+You are using version $Text::Template::VERSION instead.
+That does not make sense.\n
+Aborting"
+ unless $Text::Template::VERSION == 1.46;
+
+# (1) basic error delivery
+{ my $r = Text::Template->new(TYPE => 'string',
+ SOURCE => '{1/0}',
+ )->fill_in();
+ if ($r eq q{Program fragment delivered error ``Illegal division by zero at template line 1.''}) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n# $r\n";
+ }
+ $n++;
+}
+
+# (2) BROKEN sub called in ->new?
+{ my $r = Text::Template->new(TYPE => 'string',
+ SOURCE => '{1/0}',
+ BROKEN => sub {'---'},
+ )->fill_in();
+ if ($r eq q{---}) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n# $r\n";
+ }
+ $n++;
+}
+
+# (3) BROKEN sub called in ->fill_in?
+{ my $r = Text::Template->new(TYPE => 'string',
+ SOURCE => '{1/0}',
+ )->fill_in(BROKEN => sub {'---'});
+ if ($r eq q{---}) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n# $r\n";
+ }
+ $n++;
+}
+
+# (4) BROKEN sub passed correct args when called in ->new?
+{ my $r = Text::Template->new(TYPE => 'string',
+ SOURCE => '{1/0}',
+ BROKEN => sub { my %a = @_;
+ qq{$a{lineno},$a{error},$a{text}}
+ },
+ )->fill_in();
+ if ($r eq qq{1,Illegal division by zero at template line 1.\n,1/0}) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n# $r\n";
+ }
+ $n++;
+}
+
+# (5) BROKEN sub passed correct args when called in ->fill_in?
+{ my $r = Text::Template->new(TYPE => 'string',
+ SOURCE => '{1/0}',
+ )->fill_in(BROKEN =>
+ sub { my %a = @_;
+ qq{$a{lineno},$a{error},$a{text}}
+ });
+ if ($r eq qq{1,Illegal division by zero at template line 1.\n,1/0}) {
+ print "ok $n\n";
+ } else {
+ print "not ok $n\n# $r\n";
+ }
+ $n++;
+}
+