2
0

rt29928.t 553 B

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