+{
+ $lxs = PublicInbox::LeiXSearch->new;
+ my $v2ibx = create_inbox 'v2full', version => 2, sub {
+ $_[0]->add(eml_load('t/plack-qp.eml'));
+ };
+ my $v1ibx = create_inbox 'v1medium', indexlevel => 'medium',
+ tmpdir => "$home/v1tmp", sub {
+ $_[0]->add(eml_load('t/utf8.eml'));
+ };
+ $lxs->prepare_external($v1ibx);
+ $lxs->prepare_external($v2ibx);
+ for my $loc ($lxs->locals) {
+ $lxs->attach_external($loc);
+ }
+ my $mset = $lxs->mset('m:testmessage@example.com');
+ is($mset->size, 1, 'got m: match on medium+full XSearch mix');
+ my $mitem = ($mset->items)[0];
+ my $smsg = $lxs->smsg_for($mitem) or BAIL_OUT 'smsg_for broken';
+
+ my $ale = PublicInbox::LeiALE::_new("$home/ale");
+ my $lei = bless {}, 'PublicInbox::LEI';
+ $ale->refresh_externals($lxs, $lei);
+ my $exp = [ $smsg->{blob}, 'blob', -s 't/utf8.eml' ];
+ is_deeply([ $ale->git->check($smsg->{blob}) ], $exp, 'ale->git->check');
+
+ $lxs = PublicInbox::LeiXSearch->new;
+ $lxs->prepare_external($v2ibx);
+ $ale->refresh_externals($lxs, $lei);
+ is_deeply([ $ale->git->check($smsg->{blob}) ], $exp,
+ 'ale->git->check remembered inactive external');
+
+ rename("$home/v1tmp", "$home/v1moved") or BAIL_OUT "rename: $!";
+ $ale->refresh_externals($lxs, $lei);
+ is($ale->git->check($smsg->{blob}), undef,
+ 'missing after directory gone');
+}
+