It seems safe to use ALLCAPS labels like "INBOX" with Xapian.
We'll also allow single-character labels.
my ($label) = @_;
length($label) >= $L_MAX and
return "`$label' too long (must be <= $L_MAX)";
my ($label) = @_;
length($label) >= $L_MAX and
return "`$label' too long (must be <= $L_MAX)";
- $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@,]*[a-z0-9]\z} ?
+ $label =~ m{\A[a-z0-9_](?:[a-z0-9_\-\./\@,]*[a-z0-9])?\z}i ?
undef : "`$label' is invalid";
},
kw => sub {
undef : "`$label' is invalid";
},
kw => sub {
lei_ok(qw(ls-label));
is($lei_out, "nope\nqp\nurgent\n", 'ls-label shows qp');
lei_ok(qw(ls-label));
is($lei_out, "nope\nqp\nurgent\n", 'ls-label shows qp');
+ lei_ok qw(mark -F eml t/utf8.eml +L:INBOX +L:x); diag $lei_err;
+ lei_ok qw(q m:testmessage@example.com);
+ $check_kw->([qw(answered seen)], L => [qw(INBOX nope urgent x)]);
+ lei_ok(qw(ls-label));
+ is($lei_out, "INBOX\nnope\nqp\nurgent\nx\n", 'ls-label shows qp');
+
if (0) { # TODO label+kw search w/ externals
lei_ok(qw(q L:qp), "mid:$mid", '--only', "$ro_home/t2");
}
if (0) { # TODO label+kw search w/ externals
lei_ok(qw(q L:qp), "mid:$mid", '--only', "$ro_home/t2");
}