From 37801e172e29f70ff4657ac1ab81967ec1ae603e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 12 Sep 2018 20:30:37 +0200 Subject: handle_added_archives_with_db.t: Add 2nd top level directory to test Signed-off-by: Florian Pritz --- t/handle_added_archives_with_db.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 't/handle_added_archives_with_db.t') 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}, -- cgit v1.2.3-24-g4f1b