Skip to content
Snippets Groups Projects
Commit 69aa5473 authored by bolkun's avatar bolkun
Browse files

reworked tests which compare Windows and Linux CRLF and LF

parent 721f9f4a
Branches
Tags
No related merge requests found
...@@ -10,13 +10,46 @@ use Test::File; ...@@ -10,13 +10,46 @@ use Test::File;
use Path::Tiny; use Path::Tiny;
use File::Copy::Recursive qw(dircopy); use File::Copy::Recursive qw(dircopy);
use File::Path qw(rmtree); use File::Path qw(rmtree);
use File::Compare;
# *** Read before running tests *** # *** Read before running tests ***
# Usage: perl -I lib/ t/slubsipbuilderbagit.t # Usage: perl -I lib/ t/slubsipbuilderbagit.t
# Warning: While running project "SLUB_SIP_Builder" two directories "export_dir_kitodo/bagit" and "tmp/bagit" will be created. # Warning: While running project "SLUB_SIP_Builder" two directories "export_dir_kitodo/bagit" and "tmp/bagit" will be created.
# Start scipt in the project directory to run all tests properly. # Start scipt in the project directory to run all tests properly.
# Tested on Win10 and Debian 10
sub equalFilesByIgnoringCRLF_LF($$){
my $file_path1 = $_[0];
my $file_path2 = $_[1];
my $content1 = "";
my $content2 = "";
binmode(STDOUT);
open(my $fh1, '<', $file_path1) or die $!;
open(my $fh2, '<', $file_path2) or die $!;
# changing the CRLF to LF
while (<$fh1>) {
s/\r?\n\z//;
# print "$_\n";
$content1 .= "$_\n";
}
# changing the CRLF to LF
while (<$fh2>) {
s/\r?\n\z//;
# print "$_\n";
$content2 .= "$_\n";
}
if($content1 ne $content2){
return 0;
} else {
return 1;
}
}
### prepare ### prepare
BEGIN { BEGIN {
...@@ -649,11 +682,11 @@ is(-f $output_lidoFilePath, 1, "copyFilesToMeta() file $output_lidoFilePath exis ...@@ -649,11 +682,11 @@ is(-f $output_lidoFilePath, 1, "copyFilesToMeta() file $output_lidoFilePath exis
is(-f $output_bubbleFilePath, 1, "copyFilesToMeta() file $output_bubbleFilePath exists."); is(-f $output_bubbleFilePath, 1, "copyFilesToMeta() file $output_bubbleFilePath exists.");
is(-f $output_sameModsFilePath, 1, "copyFilesToMeta() file $output_sameModsFilePath exists. Renamed self included mods.xml"); is(-f $output_sameModsFilePath, 1, "copyFilesToMeta() file $output_sameModsFilePath exists. Renamed self included mods.xml");
is(-f $output_sameRightsFilePath, 1, "copyFilesToMeta() file $output_sameRightsFilePath exists. Renamed self included rights.xml"); is(-f $output_sameRightsFilePath, 1, "copyFilesToMeta() file $output_sameRightsFilePath exists. Renamed self included rights.xml");
is(compare($output_rightsFilePath, $input_rightsFilePath), 0, "copyFilesToMeta() file $input_rightsFilePath is identical to $output_rightsFilePath"); is(equalFilesByIgnoringCRLF_LF($output_rightsFilePath, $input_rightsFilePath), 1, "copyFilesToMeta() file $input_rightsFilePath is identical to $output_rightsFilePath");
is(compare($output_lidoFilePath, $input_lidoFilePath), 0, "copyFilesToMeta() file $input_lidoFilePath is identical to $output_lidoFilePath"); is(equalFilesByIgnoringCRLF_LF($output_lidoFilePath, $input_lidoFilePath), 1, "copyFilesToMeta() file $input_lidoFilePath is identical to $output_lidoFilePath");
is(compare($output_bubbleFilePath, $input_bubbleFilePath), 0, "copyFilesToMeta() file $input_bubbleFilePath is identical to $output_bubbleFilePath"); is(equalFilesByIgnoringCRLF_LF($output_bubbleFilePath, $input_bubbleFilePath), 1, "copyFilesToMeta() file $input_bubbleFilePath is identical to $output_bubbleFilePath");
is(compare($output_sameModsFilePath, $input_modsFilePath), 0, "copyFilesToMeta() file $input_modsFilePath is identical to $output_sameModsFilePath"); is(equalFilesByIgnoringCRLF_LF($output_sameModsFilePath, $input_modsFilePath), 1, "copyFilesToMeta() file $input_modsFilePath is identical to $output_sameModsFilePath");
is(compare($output_sameRightsFilePath, $input_rightsFilePath), 0, "copyFilesToMeta() file $input_rightsFilePath is identical to $output_sameRightsFilePath"); is(equalFilesByIgnoringCRLF_LF($output_sameRightsFilePath, $input_rightsFilePath), 1, "copyFilesToMeta() file $input_rightsFilePath is identical to $output_sameRightsFilePath");
# #
is(SLUB::LZA::SIPBuilderBagIt::getFileName($input_bubbleFilePath), "bubble.xml", "getFileName()"); is(SLUB::LZA::SIPBuilderBagIt::getFileName($input_bubbleFilePath), "bubble.xml", "getFileName()");
throws_ok{ SLUB::LZA::SIPBuilderBagIt::getFileName(undef); } qr/path with file name is not defined/, "getFileName(\$file_name), file_name undef"; throws_ok{ SLUB::LZA::SIPBuilderBagIt::getFileName(undef); } qr/path with file name is not defined/, "getFileName(\$file_name), file_name undef";
...@@ -712,15 +745,15 @@ throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit(undef, \@addBagInfo); } ...@@ -712,15 +745,15 @@ throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit(undef, \@addBagInfo); }
throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit($bag_output_path, undef); } qr/array of hashes not defined for bag-info.txt/, "create_slub_bagit(\$bagPath, \$refAddBagInfo), refAddBagInfo undef"; throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit($bag_output_path, undef); } qr/array of hashes not defined for bag-info.txt/, "create_slub_bagit(\$bagPath, \$refAddBagInfo), refAddBagInfo undef";
throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit("", \@addBagInfo); } qr/path is not directory/, "create_slub_bagit(\$bagPath, \$refAddBagInfo), bagPath is not a directory"; throws_ok{ SLUB::LZA::SIPBuilderBagIt::create_slub_bagit("", \@addBagInfo); } qr/path is not directory/, "create_slub_bagit(\$bagPath, \$refAddBagInfo), bagPath is not a directory";
is(compare($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 0, "create_slub_bagit() $bag: validate data/test.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 1, "create_slub_bagit() $bag: validate data/test.txt");
is(compare($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 0, "create_slub_bagit() $bag: validate meta/mods.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 1, "create_slub_bagit() $bag: validate meta/mods.xml");
is(compare($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 0, "create_slub_bagit() $bag: validate meta/rights.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 1, "create_slub_bagit() $bag: validate meta/rights.xml");
# is(compare($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 0, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 1, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated
is(compare($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 0, "create_slub_bagit() $bag: validate bagit.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 1, "create_slub_bagit() $bag: validate bagit.txt");
is(compare($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 0, "create_slub_bagit() $bag: manifest-md5.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 1, "create_slub_bagit() $bag: manifest-md5.txt");
is(compare($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 0, "create_slub_bagit() $bag: manifest-sha512.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 1, "create_slub_bagit() $bag: manifest-sha512.txt");
# is(compare($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 0, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 1, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum
# is(compare($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 0, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 1, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum
# #
$ie = 'test2'; $ie = 'test2';
$bag = 'test2_bag'; $bag = 'test2_bag';
...@@ -733,17 +766,17 @@ $valid_bag_path = $input_path . '/' . $valid_bag; ...@@ -733,17 +766,17 @@ $valid_bag_path = $input_path . '/' . $valid_bag;
ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithCopyOption($ppn, $noppn, $ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithCopyOption()"); ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithCopyOption($ppn, $noppn, $ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithCopyOption()");
is(compare($bag_output_path . '/data/scans_tif/00000001.tif', $valid_bag_path . '/data/scans_tif/00000001.tif'), 0, "create_slub_bagit() $bag: validate data/scans_tif/00000001.tif"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/scans_tif/00000001.tif', $valid_bag_path . '/data/scans_tif/00000001.tif'), 1, "create_slub_bagit() $bag: validate data/scans_tif/00000001.tif");
is(compare($bag_output_path . '/data/scans_tif/00000002.tif', $valid_bag_path . '/data/scans_tif/00000002.tif'), 0, "create_slub_bagit() $bag: validate data/scans_tif/00000002.tif"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/scans_tif/00000002.tif', $valid_bag_path . '/data/scans_tif/00000002.tif'), 1, "create_slub_bagit() $bag: validate data/scans_tif/00000002.tif");
is(compare($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 0, "create_slub_bagit() $bag: validate data/test.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 1, "create_slub_bagit() $bag: validate data/test.txt");
is(compare($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 0, "create_slub_bagit() $bag: validate meta/mods.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 1, "create_slub_bagit() $bag: validate meta/mods.xml");
is(compare($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 0, "create_slub_bagit() $bag: validate meta/rights.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 1, "create_slub_bagit() $bag: validate meta/rights.xml");
# is(compare($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 0, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 1, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated
is(compare($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 0, "create_slub_bagit() $bag: validate bagit.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 1, "create_slub_bagit() $bag: validate bagit.txt");
is(compare($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 0, "create_slub_bagit() $bag: manifest-md5.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 1, "create_slub_bagit() $bag: manifest-md5.txt");
is(compare($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 0, "create_slub_bagit() $bag: manifest-sha512.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 1, "create_slub_bagit() $bag: manifest-sha512.txt");
# is(compare($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 0, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 1, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum
# is(compare($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 0, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 1, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum
# #
$ie = 'test3'; $ie = 'test3';
$bag = 'test3_bag'; $bag = 'test3_bag';
...@@ -759,17 +792,17 @@ File::Copy::Recursive::dircopy($ie_input_path, $new_ie_input_path) or die "Could ...@@ -759,17 +792,17 @@ File::Copy::Recursive::dircopy($ie_input_path, $new_ie_input_path) or die "Could
ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithMoveOption($ppn, $noppn, $new_ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithMoveOption()"); ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithMoveOption($ppn, $noppn, $new_ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithMoveOption()");
is(compare($bag_output_path . '/data/img/scans_tif/00000001.tif', $valid_bag_path . '/data/img/scans_tif/00000001.tif'), 0, "create_slub_bagit() $bag: validate data/img/scans_tif/00000001.tif"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/img/scans_tif/00000001.tif', $valid_bag_path . '/data/img/scans_tif/00000001.tif'), 1, "create_slub_bagit() $bag: validate data/img/scans_tif/00000001.tif");
is(compare($bag_output_path . '/data/img/scans_tif/00000002.tif', $valid_bag_path . '/data/img/scans_tif/00000002.tif'), 0, "create_slub_bagit() $bag: validate data/img/scans_tif/00000002.tif"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/img/scans_tif/00000002.tif', $valid_bag_path . '/data/img/scans_tif/00000002.tif'), 1, "create_slub_bagit() $bag: validate data/img/scans_tif/00000002.tif");
is(compare($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 0, "create_slub_bagit() $bag: validate data/test.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/test.txt', $valid_bag_path . '/data/test.txt'), 1, "create_slub_bagit() $bag: validate data/test.txt");
is(compare($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 0, "create_slub_bagit() $bag: validate meta/mods.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 1, "create_slub_bagit() $bag: validate meta/mods.xml");
is(compare($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 0, "create_slub_bagit() $bag: validate meta/rights.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 1, "create_slub_bagit() $bag: validate meta/rights.xml");
# is(compare($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 0, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 1, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated
is(compare($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 0, "create_slub_bagit() $bag: validate bagit.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 1, "create_slub_bagit() $bag: validate bagit.txt");
is(compare($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 0, "create_slub_bagit() $bag: manifest-md5.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 1, "create_slub_bagit() $bag: manifest-md5.txt");
is(compare($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 0, "create_slub_bagit() $bag: manifest-sha512.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 1, "create_slub_bagit() $bag: manifest-sha512.txt");
# is(compare($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 0, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 1, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum
# is(compare($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 0, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 1, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum
# #
$ie = 'test4'; $ie = 'test4';
$bag = 'test4_bag'; $bag = 'test4_bag';
...@@ -785,16 +818,16 @@ File::Copy::Recursive::dircopy($ie_input_path, $new_ie_input_path) or die "Could ...@@ -785,16 +818,16 @@ File::Copy::Recursive::dircopy($ie_input_path, $new_ie_input_path) or die "Could
ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithReplaceOption($ppn, $noppn, $new_ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithReplaceOption()"); ok(SLUB::LZA::SIPBuilderBagIt::buildBagWithReplaceOption($ppn, $noppn, $new_ie_input_path, $input_rightsFilePath, \@addMetaFile, \@addBagInfo, $bag_output_path, $data_output_path, $meta_output_path), "buildBagWithReplaceOption()");
is(compare($bag_output_path . '/data/dir_test_äöüÄÖÜß/test2.txt', $valid_bag_path . '/data/dir_test_äöüÄÖÜß/test2.txt'), 0, "create_slub_bagit() $bag: validate data/dir_test_äöüÄÖÜß/test2.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/dir_test_äöüÄÖÜß/test2.txt', $valid_bag_path . '/data/dir_test_äöüÄÖÜß/test2.txt'), 1, "create_slub_bagit() $bag: validate data/dir_test_äöüÄÖÜß/test2.txt");
is(compare($bag_output_path . '/data/test_äöüÄÖÜß.txt', $valid_bag_path . '/data/test_äöüÄÖÜß.txt'), 0, "create_slub_bagit() $bag: validate data/test_äöüÄÖÜß.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/data/test_äöüÄÖÜß.txt', $valid_bag_path . '/data/test_äöüÄÖÜß.txt'), 1, "create_slub_bagit() $bag: validate data/test_äöüÄÖÜß.txt");
is(compare($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 0, "create_slub_bagit() $bag: validate meta/mods.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/mods.xml', $valid_bag_path . '/meta/mods.xml'), 1, "create_slub_bagit() $bag: validate meta/mods.xml");
is(compare($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 0, "create_slub_bagit() $bag: validate meta/rights.xml"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/meta/rights.xml', $valid_bag_path . '/meta/rights.xml'), 1, "create_slub_bagit() $bag: validate meta/rights.xml");
# is(compare($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 0, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bag-info.txt', $valid_bag_path . '/bag-info.txt'), 1, "create_slub_bagit() $bag: validate bag-info.txt"); # will fail, bacause Bagging-Date is auto generated
is(compare($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 0, "create_slub_bagit() $bag: validate bagit.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/bagit.txt', $valid_bag_path . '/bagit.txt'), 1, "create_slub_bagit() $bag: validate bagit.txt");
is(compare($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 0, "create_slub_bagit() $bag: manifest-md5.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-md5.txt', $valid_bag_path . '/manifest-md5.txt'), 1, "create_slub_bagit() $bag: manifest-md5.txt");
is(compare($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 0, "create_slub_bagit() $bag: manifest-sha512.txt"); is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/manifest-sha512.txt', $valid_bag_path . '/manifest-sha512.txt'), 1, "create_slub_bagit() $bag: manifest-sha512.txt");
# is(compare($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 0, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-md5.txt', $valid_bag_path . '/tagmanifest-md5.txt'), 1, "create_slub_bagit() $bag: tagmanifest-md5.txt"); # will fail, bacause bag-info.txt checksum
# is(compare($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 0, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum # is(equalFilesByIgnoringCRLF_LF($bag_output_path . '/tagmanifest-sha512.txt', $valid_bag_path . '/tagmanifest-sha512.txt'), 1, "create_slub_bagit() $bag: tagmanifest-sha512.txt"); # will fail, bacause bag-info.txt checksum
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment