}
symlink(abs_path('t/data/0001.patch'), "$md/cur/x:2,S") or
BAIL_OUT "symlink $md $!";
- lei_ok(qw(import), $md, \'import Maildir');
+ lei_ok(qw(import), "$md/", \'import Maildir');
my $imp_err = $lei_err;
my %i;
lei_ok('inspect', $md); $i{no_type} = $lei_out;
+ lei_ok('inspect', "$md/"); $i{no_type_tslash} = $lei_out;
lei_ok('inspect', "maildir:$md"), $i{with_type} = $lei_out;
+ lei_ok('inspect', "maildir:$md/"), $i{with_type_tslash} = $lei_out;
+ lei_ok('inspect', "MAILDIR:$md"), $i{ALLCAPS} = $lei_out;
lei_ok(['inspect', $md], undef, { -C => $ENV{HOME}, %$lei_opt });
$i{rel_no_type} = $lei_out;
lei_ok(['inspect', "maildir:$md"], undef,
is(scalar(keys %v), 1, 'inspect handles relative and absolute paths');
my $inspect = json_utf8->decode([ keys %v ]->[0]);
is_deeply($inspect, {"maildir:$md" => { 'name.count' => 1 }},
- 'inspect maildir: path had expected output');
+ 'inspect maildir: path had expected output') or xbail($inspect);
lei_ok(qw(q s:boolean));
my $res = json_utf8->decode($lei_out);
$res = json_utf8->decode($lei_out);
is_deeply($res, [ undef ], 'trashed message not imported')
or diag explain($imp_err, $res);
+
+ lei_ok qw(rm t/data/0001.patch);
+ lei_ok(qw(q s:boolean));
+ is($lei_out, "[null]\n", 'removed message gone from results');
+ my $g0 = "$ENV{HOME}/.local/share/lei/store/local/0.git";
+ my $x = xqx(['git', "--git-dir=$g0", qw(cat-file blob HEAD:d)]);
+ is($?, 0, "git cat-file shows file is `d'");
});
done_testing;