This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add C define to remove taint support from perl
[perl5.git] / dist / Locale-Maketext / t / 09_compile.t
CommitLineData
e9c9ffca
TR
1#!perl -T
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
8use Scalar::Util qw(tainted);
9use Locale::Maketext;
10
11my @ENV_values = values %ENV;
12my $tainted_value;
13do { $tainted_value = shift @ENV_values } while(!$tainted_value || ref $tainted_value);
6aac7955 14$tainted_value =~ s/([\[\]])/~$1/g;
e9c9ffca 15
284167a5
S
16# If ${^TAINT} is not set despite -T, thsi perl doesn't have taint support
17ok(!${^TAINT} || tainted($tainted_value), "\$tainted_value is tainted") or die('huh... %ENV has no entries? I don\'t know how to test taint without it');
e9c9ffca
TR
18
19my $result = Locale::Maketext::_compile("hello [_1]", $tainted_value);
20
21pass("_compile does not hang on tainted values");
22