- my $n = "index-cap-$desc";
- run_script([qw(-init -L basic -V2), $n, "$home/$n",
- "http://example.com/$n", "$n\@example.com"]) or
- BAIL_OUT 'init';
- my $ibx = PublicInbox::Config->new->lookup_name($n);
- my $im = PublicInbox::InboxWritable->new($ibx)->importer(0);
- for my $m (@$msgs) {
- $im->add(PublicInbox::Eml->new("$m\nFrom: x\@example.com\n\n"));
- }
- $im->done;
+ my $n = "index-cap-$desc-basic";
+ # yes, the shuffle case gets memoized by create_inbox, oh well
+ my $ibx = create_inbox $desc, version => 2, indexlevel => 'basic',
+ tmpdir => "$home/$desc", sub {
+ my ($im) = @_;
+ for my $m (@$msgs) {
+ my $x = "$m\nFrom: x\@example.com\n\n";
+ $im->add(PublicInbox::Eml->new(\$x));
+ }
+ };