Last change
on this file since 101021 was 101021, checked in by vboxsync, 15 months ago |
openssl-3.1.2: Applied and adjusted our OpenSSL changes to 3.1.0. bugref:10519
|
File size:
1.3 KB
|
Line | |
---|
1 | #!perl
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use warnings;
|
---|
5 | use Text::Template;
|
---|
6 |
|
---|
7 | # Minimum Test::More version; 0.94+ is required for `done_testing`
|
---|
8 | BEGIN {
|
---|
9 | unless (eval { require Test::More; "$Test::More::VERSION" >= 0.94; }) {
|
---|
10 | Test::More::plan(skip_all => '[ Test::More v0.94+ ] is required for testing');
|
---|
11 | }
|
---|
12 |
|
---|
13 | Test::More->import;
|
---|
14 |
|
---|
15 | # Non-CORE module(s)
|
---|
16 | unless (eval { require Test::Warnings; 1; }) {
|
---|
17 | plan(skip_all => '[ Test::Warnings ] is required for testing');
|
---|
18 | }
|
---|
19 |
|
---|
20 | Test::Warnings->import;
|
---|
21 | }
|
---|
22 |
|
---|
23 | my $template = <<'EOT';
|
---|
24 | {{
|
---|
25 | if ($good =~ /good/) {
|
---|
26 | 'This template should not produce warnings.'.$bad;
|
---|
27 | }
|
---|
28 | }}
|
---|
29 | EOT
|
---|
30 |
|
---|
31 | $template = Text::Template->new(type => 'STRING', source => $template);
|
---|
32 | isa_ok $template, 'Text::Template';
|
---|
33 |
|
---|
34 | my $result = $template->fill_in(HASH => { good => 'good' });
|
---|
35 |
|
---|
36 | $result =~ s/(?:^\s+)|(?:\s+$)//gs;
|
---|
37 | is $result, 'This template should not produce warnings.';
|
---|
38 |
|
---|
39 | # see https://github.com/mschout/perl-text-template/issues/10
|
---|
40 | $template = Text::Template->new(type => 'STRING', package => 'MY', source => '');
|
---|
41 | $template->fill_in(package => 'MY', hash => { include => sub { 'XX' } });
|
---|
42 |
|
---|
43 | $template = Text::Template->new(type => 'STRING', package => 'MY', source => '');
|
---|
44 | $template->fill_in(package => 'MY', hash => { include => sub { 'XX' } });
|
---|
45 |
|
---|
46 | done_testing;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.