summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-12 20:30:37 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-12 20:31:44 +0200
commit37801e172e29f70ff4657ac1ab81967ec1ae603e (patch)
tree9260be4cc0304a5710156c992ca1b6757702bafd /t
parent6259722fb45231ddcff05d6b43f1d513cd71f617 (diff)
downloadApp-BorgRestore-37801e172e29f70ff4657ac1ab81967ec1ae603e.tar.gz
App-BorgRestore-37801e172e29f70ff4657ac1ab81967ec1ae603e.tar.xz
handle_added_archives_with_db.t: Add 2nd top level directory to test
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 't')
-rw-r--r--t/handle_added_archives_with_db.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/handle_added_archives_with_db.t b/t/handle_added_archives_with_db.t
index c8b0ff8..908ed68 100644
--- a/t/handle_added_archives_with_db.t
+++ b/t/handle_added_archives_with_db.t
@@ -31,6 +31,9 @@ for my $in_memory (0,1) {
$cb->("XXX, 1970-01-01 00:00:04 boot/test1/f2");
$cb->("XXX, 1970-01-01 00:00:03 boot/test1/f3");
$cb->("XXX, 1970-01-01 00:00:02 boot/test1/f4");
+ $cb->("XXX, 1970-01-01 00:00:03 etc");
+ $cb->("XXX, 1970-01-01 00:00:02 etc/foo");
+ $cb->("XXX, 1970-01-01 00:00:01 etc/foo/bar");
} );
# Call the actual function we want to test
@@ -50,6 +53,9 @@ for my $in_memory (0,1) {
eq_or_diff($db->get_archives_for_path('boot/test1/f2'), [{archive => 'archive-1', modification_time => 4},]);
eq_or_diff($db->get_archives_for_path('boot/test1/f3'), [{archive => 'archive-1', modification_time => 3},]);
eq_or_diff($db->get_archives_for_path('boot/test1/f4'), [{archive => 'archive-1', modification_time => 2},]);
+ eq_or_diff($db->get_archives_for_path('etc'), [{archive => 'archive-1', modification_time => 3},]);
+ eq_or_diff($db->get_archives_for_path('etc/foo'), [{archive => 'archive-1', modification_time => 2},]);
+ eq_or_diff($db->get_archives_for_path('etc/foo/bar'), [{archive => 'archive-1', modification_time => 1},]);
eq_or_diff($db->get_archives_for_path('lulz'), [{archive => 'archive-1', modification_time => undef},]);
@@ -70,6 +76,9 @@ for my $in_memory (0,1) {
$cb->("XXX, 1970-01-01 00:00:03 boot/test1/f3");
$cb->("XXX, 1970-01-01 00:00:02 boot/test1/f4");
$cb->("XXX, 1970-01-01 00:00:07 boot/test1/f5");
+ $cb->("XXX, 1970-01-01 00:00:03 etc");
+ $cb->("XXX, 1970-01-01 00:00:02 etc/foo");
+ $cb->("XXX, 1970-01-01 00:00:01 etc/foo/bar");
} );
$app->_handle_added_archives(['archive-2']);
@@ -126,6 +135,18 @@ for my $in_memory (0,1) {
{archive => 'archive-1', modification_time => undef},
{archive => 'archive-2', modification_time => 7},
]);
+ eq_or_diff($db->get_archives_for_path('etc'), [
+ {archive => 'archive-1', modification_time => 3},
+ {archive => 'archive-2', modification_time => 3},
+ ]);
+ eq_or_diff($db->get_archives_for_path('etc/foo'), [
+ {archive => 'archive-1', modification_time => 2},
+ {archive => 'archive-2', modification_time => 2},
+ ]);
+ eq_or_diff($db->get_archives_for_path('etc/foo/bar'), [
+ {archive => 'archive-1', modification_time => 1},
+ {archive => 'archive-2', modification_time => 1},
+ ]);
eq_or_diff($db->get_archives_for_path('lulz'), [
{archive => 'archive-1', modification_time => undef},
{archive => 'archive-2', modification_time => undef},