+
+ for my $no (['--no-local'], ['--no-external'],
+ [qw(--no-local --no-external)]) {
+ lei_ok(qw(q mid:testmessage@example.com), @$no,
+ '-I', $dirs[0], \"-I and @$no combine");
+ $res = json_utf8->decode($lei_out);
+ is($res->[0]->{'m'}, 'testmessage@example.com',
+ "-I \$DIR got results regardless of @$no");
+ }
+
+ {
+ skip 'TEST_LEI_DAEMON_PERSIST_DIR in use', 1 if
+ $ENV{TEST_LEI_DAEMON_PERSIST_DIR};
+ my @q = qw(q -o mboxcl2:rel.mboxcl2 bye);
+ lei_ok('-C', $home, @q);
+ is(unlink("$home/rel.mboxcl2"), 1, '-C works before q');
+
+ # we are more flexible than git, here:
+ lei_ok(@q, '-C', $home);
+ is(unlink("$home/rel.mboxcl2"), 1, '-C works after q');
+ mkdir "$home/deep" or BAIL_OUT $!;
+ lei_ok('-C', $home, @q, '-C', 'deep');
+ is(unlink("$home/deep/rel.mboxcl2"), 1, 'multiple -C works');
+
+ lei_ok('-C', '', '-C', $home, @q, '-C', 'deep', '-C', '');
+ is(unlink("$home/deep/rel.mboxcl2"), 1, "-C '' accepted");
+ ok(!-f "$home/rel.mboxcl2", 'wrong path not created');
+ }