BEGIN {use_ok(
'Games::Freelancer::UTF'
); }
eval
{
Test::NoWarnings->
import
();
1;
} or
do
{
SKIP: {
skip
"Test::NoWarnings is not installed"
, 1;
fail
"This shouldn't really happen at all"
;
};
};
$tree
= {
'\\'
=> {
'VMeshLibrary'
=> {
'jc_defender.lod0.vms'
=> {
'VMeshData'
=>
'Some Vmeshdata'
}
},
'Cmpnd'
=> {
'Root'
=> {
'File name'
=>
'jc_defender.3db'
,
'Index'
=>
''
,
'Object name'
=>
'Root'
}
},
'jc_defender.3db'
=> {
'Hardpoints'
=> {
'Fixed'
=> {
'HpEngine01'
=> {
'Orientation'
=>
'???'
,
'Position'
=>
'IK¿×A'
},
},
'Revolute'
=> {
'HpWeapon01'
=> {
'Axis'
=>
'?'
,
'Max'
=> '
>',
'Min'
=> '
¾',
'Orientation'
=>
'Z|¿âÐ1¾âÐ1>Z|¿?'
,
'Position'
=>
'L?ø®>¿+±À'
},
'HpWeapon02'
=> {
'Axis'
=>
'?'
,
'Max'
=> '
>',
'Min'
=> '
¾',
'Orientation'
=>
'Z|¿âÐ1>âÐ1¾Z|¿?'
,
'Position'
=>
'r¿ø®>¿+±À'
}
}
},
'MultiLevel'
=> {
'Level0'
=> {
'VMeshPart'
=> {
'VMeshRef'
=> '<Úýxn
¯Ë@ÄËÀ°?d÷¤¿-¬Aï7Á`:m$½ð¢½ä,A'
}
}
}
}
}
};
my
$data
;
eval
{
$data
=UTFwrite(
$tree
);
};
ok(!$@,
"Writing errors"
);
undef
$@;
my
$tree2
;
eval
{
$tree2
=UTFread(
$data
);
};
ok(!$@,
"Reading errors"
);
undef
$@;
is_deeply(
$tree
,
$tree2
,
"Differences between original and reread trees"
);