Last change
on this file since 100620 was 94320, checked in by vboxsync, 3 years ago |
libs/openssl-3.0.1: Export to OSE and fix copyright headers in Makefiles, bugref:10128
|
File size:
808 bytes
|
Line | |
---|
1 | #!perl
|
---|
2 | #
|
---|
3 | # test apparatus for Text::Template module
|
---|
4 | # still incomplete.
|
---|
5 |
|
---|
6 | use strict;
|
---|
7 | use warnings;
|
---|
8 | use Test::More tests => 6;
|
---|
9 |
|
---|
10 | use_ok 'Text::Template' or exit 1;
|
---|
11 |
|
---|
12 | # (1-2) Missing source
|
---|
13 | eval {
|
---|
14 | Text::Template->new();
|
---|
15 | pass;
|
---|
16 | };
|
---|
17 |
|
---|
18 | like $@, qr/^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/;
|
---|
19 |
|
---|
20 | eval { Text::Template->new(TYPE => 'FILE'); };
|
---|
21 | like $@, qr/^\QUsage: Text::Template::new(TYPE => ..., SOURCE => ...)/;
|
---|
22 |
|
---|
23 | # (3) Invalid type
|
---|
24 | eval { Text::Template->new(TYPE => 'wlunch', SOURCE => 'fish food'); };
|
---|
25 | like $@, qr/^\QIllegal value `WLUNCH' for TYPE parameter/;
|
---|
26 |
|
---|
27 | # (4-5) File does not exist
|
---|
28 | my $o = Text::Template->new(
|
---|
29 | TYPE => 'file',
|
---|
30 | SOURCE => 'this file does not exist');
|
---|
31 | ok !defined $o;
|
---|
32 |
|
---|
33 | ok defined($Text::Template::ERROR)
|
---|
34 | && $Text::Template::ERROR =~ /^Couldn't open file/;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.