Update the bundled external perl module Text-Template to version 1.56
[oweals/openssl.git] / external / perl / Text-Template-1.56 / t / rt29928.t
1 #!perl
2 #
3 # Test for RT Bug 29928 fix
4 # https://rt.cpan.org/Public/Bug/Display.html?id=29928
5
6 use strict;
7 use warnings;
8 use Test::More tests => 2;
9
10 use_ok 'Text::Template::Preprocess' or exit 1;
11
12 my $tin = q{The value of $foo is: {$foo}.};
13
14 sub tester {
15     1;    # dummy preprocessor to cause the bug described.
16 }
17
18 my $tmpl1 = Text::Template::Preprocess->new(TYPE => 'STRING', SOURCE => $tin);
19
20 $tmpl1->compile;
21
22 my $t1 = $tmpl1->fill_in(
23     HASH         => { foo => 'things' },
24     PREPROCESSOR => \&tester);
25
26 is $t1, 'The value of $foo is: things.';