⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
YAML-LibYAML-0.89-0
/
t
/
View File Name :
boolean-invalid.t
use FindBin '$Bin'; use lib $Bin; use TestYAMLTests; my @disable = (['int 0', 0], ['string 0', '0'], ['empty string', ''], ['undef', undef]); my @invalid = (['int 1', 1], ['string 1', '1'], ['string foo', 'foo']); my $tests = (@disable + 2 * @invalid); plan tests => $tests; for (@invalid) { my ($label, $test) = @$_; local $YAML::XS::Boolean = $test; my $data = eval { Load "dummy" }; # $@ and diag "ERROR: $@"; cmp_ok($@, '=~', qr{accepts}, "YAML::XS::Load: $label is an invalid setting"); my $yaml = eval { Dump { foo => 42 } }; # $@ and diag "ERROR: $@"; cmp_ok($@, '=~', qr{accepts}, "YAML::XS::Dump: $label is an invalid setting"); } for (@disable) { my ($label, $test) = @$_; local $YAML::XS::Boolean = $test; my $data = eval { Load "true" }; if ($@) { diag "ERROR: $@"; ok(0, "$label disables YAML::XS::Boolean"); } else { my $ref = ref $data; cmp_ok($ref, 'eq', '', "$label disables YAML::XS::Boolean"); } }