HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //root/.cpanm/latest-build/version-0.9933/t/11_taint.t
#!perl -T
use Test::More;
use version;

BEGIN {
    eval "use Test::Taint";
    if ($@) {
	plan skip_all => "No Test::Taint available";
    } else {
	plan tests => 6;
    }
}

taint_checking_ok();
my $v = 'v1.2.3';
taint($v);
tainted_ok($v, 'Set string as tainted');
my $v2 = version->parse($v);
isnt("$v2", '', 'Correctly parsed the tainted string');
tainted_ok($v2, 'Resulting version object is tainted');

my $vs = "$v2";
tainted_ok($vs, 'Stringified object still tainted');
is $v2, 'v1.2.3', 'Comparison to tainted object';