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