This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
This patch with tests resolves CPAN RT #40727. The issue is an infi-
[perl5.git] / dist / Locale-Maketext / t / 09_compile.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 2;
7
8 use Scalar::Util qw(tainted);
9 use Locale::Maketext;
10
11 my @ENV_values = values %ENV;
12 my $tainted_value;
13 do { $tainted_value = shift @ENV_values  } while(!$tainted_value || ref $tainted_value);
14
15 ok(tainted($tainted_value), "\$tainted_value is tainted") or die('huh... %ENV has no entries? I don\'t know how to test taint without it');
16
17 my $result = Locale::Maketext::_compile("hello [_1]", $tainted_value);
18
19 pass("_compile does not hang on tainted values");
20