#!perl
BEGIN {
require
"t/common.pl"
}
? plan
tests
=> 1
: plan
skip_all
=>
'XML::SAX::Base and XML::SAX::Writer need to be installed'
;
my
$infile
=
"data/00-in.ldif"
;
my
$outfile1
=
"$TEMPDIR/05-out1.dsml"
;
my
$cmpfile1
=
"data/05-cmp.dsml"
;
my
$ldif
= Net::LDAP::LDIF->new(
$infile
,
"r"
);
@entry
=
$ldif
->
read
;
open
(FH,
">$outfile1"
);
binmode
FH;
my
$dsml
= Net::LDAP::DSML->new(
output
=> \
*FH
,
pretty_print
=> 1);
$dsml
->write_entry(
$_
)
for
@entry
;
$dsml
->end_dsml;
close
(FH);
{
open
(FH,
"+<$outfile1"
);
binmode
FH;
local
$/;
my
$txt
= <FH>;
$txt
=~ s/>\n[\n\t ]+/>\n/g;
$txt
=~ s/\
"/'/g; # convert "
to ' in tag attribute
values
seek
(FH, 0, 0);
print
FH
$txt
;
truncate
(FH,
length
(
$txt
));
close
(FH);
}
ok(!compare_text(
$cmpfile1
,
$outfile1
),
$cmpfile1
);