diff options
author | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-04-30 00:33:56 +0200 |
---|---|---|
committer | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-04-30 00:33:56 +0200 |
commit | aa4d426b4d3527d7e166df1a05058c9a4a0f6683 (patch) | |
tree | 4ff17ce8b89a2321b9d0ed4bcfc37c447bcb6820 /openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t | |
download | smtps-and-pop3s-console-program-aa4d426b4d3527d7e166df1a05058c9a4a0f6683.tar.gz smtps-and-pop3s-console-program-aa4d426b4d3527d7e166df1a05058c9a4a0f6683.zip |
Diffstat (limited to 'openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t')
-rw-r--r-- | openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t b/openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t new file mode 100644 index 0000000..40f9fac --- /dev/null +++ b/openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t @@ -0,0 +1,63 @@ +#!perl +# +# test apparatus for Text::Template module +# still incomplete. + +use Text::Template; + +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; + +print "1..5\n"; +$n = 1; + +# (1-2) Missing source +eval { + Text::Template->new(); +}; +unless ($@ =~ /^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/) { + print STDERR $@; + print "not "; +} +print "ok $n\n"; +$n++; + +eval { + Text::Template->new(TYPE => 'FILE'); +}; +if ($@ =~ /^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/) { + print "ok $n\n"; +} else { + print STDERR $@; + print "not ok $n\n"; +} +$n++; + +# (3) Invalid type +eval { + Text::Template->new(TYPE => 'wlunch', SOURCE => 'fish food'); +}; +if ($@ =~ /^\QIllegal value `WLUNCH' for TYPE parameter/) { + print "ok $n\n"; +} else { + print STDERR $@; + print "not ok $n\n"; +} +$n++; + +# (4-5) File does not exist +my $o = Text::Template->new(TYPE => 'file', + SOURCE => 'this file does not exist'); +print $o ? "not ok $n\n" : "ok $n\n"; +$n++; +print defined($Text::Template::ERROR) + && $Text::Template::ERROR =~ /^Couldn't open file/ + ? "ok $n\n" : "not ok $n\n"; +$n++; + + +exit; + |