use
5.008;
ok( 1,
'Module loading'
);
my
$TESTDUMP
=
't/test.dump'
;
my
$df
;
my
$df2
;
my
$outfh
;
my
$output
;
my
$infh
;
my
$input
;
ok(
open
(IN,
'<'
,
$TESTDUMP
) &&
(
$input
=
join
(
''
, <IN>)) &&
close
(IN)
,
'Could read test dumpfile.'
);
open
(
$outfh
,
'>'
, \
$output
);
$df
= new SVN::Dumpfile(
$TESTDUMP
);
ok(
defined
$df
);
ok(
$df
->
open
);
ok(
$df
->version_supported );
is(
$df
->version, 2 );
is(
$df
->uuid,
'9455fc8f-b1e6-4153-aa4f-ffbcff6ea47d'
);
$df2
=
$df
->copy->create(
$outfh
);
ok(
defined
$df2
);
ok(
$df2
->version_supported );
is(
$df2
->version, 2 );
is(
$df2
->uuid,
'9455fc8f-b1e6-4153-aa4f-ffbcff6ea47d'
);
while
(
my
$node
=
$df
->read_node ) {
ok(
$df2
->write_node(
$node
),
'write node'
);
}
close
(
$outfh
);
ok (
$input
eq
$output
,
'Null-filter doesn\'t change file'
);
$df
=
undef
;
$df2
=
undef
;
open
(
$outfh
,
'>'
, \
$output
);
$df
= new SVN::Dumpfile(
$TESTDUMP
);
$df
->
open
;
$df2
=
$df
->copy->create(
$outfh
);
ok(
defined
$df2
);
ok(
$df2
->{fh}->opened );
while
(
my
$node
=
$df
->read_node ) {
$node
->changed;
ok(
$node
->has_changed );
ok(
$df2
->write_node(
$node
),
'write node'
);
}
close
(
$outfh
);
ok (
$input
eq
$output
,
'Null-filter with recalc doesn\'t change file'
);
1;