HEX
Server: Apache
System: Linux vps-15179318.kohladvogados.com.br 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
User: kohlsol (1004)
PHP: 8.3.32
Disabled: NONE
Upload Files
File: /home/.cpan/build/YAML-LibYAML-v0.904.0-0/t/file.t
use FindBin '$Bin';
use lib $Bin;
use TestYAML tests => 7;

use YAML::XS qw'LoadFile';

ok exists &LoadFile, 'LoadFile is imported';
ok not(exists &DumpFile), 'DumpFile is not imported';
ok not(exists &Dump), 'Dump is not imported';

rmtree('t/output');
mkdir('t/output');

my $test_file = 't/output/test.yaml';
ok not(-f $test_file), 'YAML output file does not exist yet';

my $t1 = {foo => [1..4]};
my $t2 = 'howdy ho';
YAML::XS::DumpFile($test_file, $t1, $t2);

ok -f $test_file, 'YAML output file exists';

my ($t1_, $t2_) = LoadFile($test_file);

is_deeply [$t1_, $t2_], [$t1, $t2], 'File roundtrip ok';

my $t3 = {"foo\x{123}" => [1..4]};
my $t4 = "howdy ho \x{5050}";
YAML::XS::DumpFile($test_file, $t3, $t4);

my ($t3_, $t4_) = LoadFile($test_file);

is_deeply [$t3_, $t4_], [$t3, $t4], 'Unicode roundtrip ok';

END {
    rmtree('t/output');
}