From c8b441f4ddcb9f6cbbe54cd380fe89586d023124 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 14 Oct 2021 03:12:25 +0000 Subject: lei inspect: account for non-extindex inboxes Inbox->xdb does not exist, but this code path was apparently never tested :x I noticed this on basic v2 inbox, but it could happen with any v1/v2 inbox. Move ->num2docid into Search so it's less awkward to use. --- t/lei-mirror.t | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/lei-mirror.t b/t/lei-mirror.t index 294eb654..646ff2b1 100644 --- a/t/lei-mirror.t +++ b/t/lei-mirror.t @@ -176,6 +176,12 @@ SKIP: { $f = "$d/t2/msgmap.sqlite3"; $ca = PublicInbox::Msgmap->new_file($f)->created_at; is($ca, $created{v2}, 'clone + index v1 synced ->created_at'); + test_lei(sub { + lei_ok qw(inspect num:1 --dir), "$d/t1"; + ok(ref(json_utf8->decode($lei_out)), 'inspect num: on v1'); + lei_ok qw(inspect num:1 --dir), "$d/t2"; + ok(ref(json_utf8->decode($lei_out)), 'inspect num: on v2'); + }); } ok($td->kill, 'killed -httpd'); -- cgit v1.2.3-24-ge0c7