diff options
author | Eric Wong <e@80x24.org> | 2021-02-10 08:59:26 -0100 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-10 19:21:47 +0000 |
commit | efae1c2f67220c18f57bd1ebdf7115abd4d6c6e0 (patch) | |
tree | 0123b9c732525e40e199d2fdfb558d9ef2fcab33 /t/search.t | |
parent | 9eb840de546dfe9b6c6aa1588f5bb8c0153c7d71 (diff) | |
download | public-inbox-efae1c2f67220c18f57bd1ebdf7115abd4d6c6e0.tar.gz |
This fixes both an old bug in "lei q" argv handling and one recent regression introduced with the change to use approxidate. Field prefixes are also handled correctly inside parenthesized statements when the field follows "(" without a separation character. Fixes: fbb7ccabbf54a405 ("lei q: use git approxidate with d:, dt: and rt: ranges")
Diffstat (limited to 't/search.t')
-rw-r--r-- | t/search.t | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -536,13 +536,20 @@ $ibx->with_umask(sub { }); SKIP: { + my ($s, $g) = ($ibx->search, $ibx->git); + my $q = $s->query_argv_to_string($g, ["quoted phrase"]); + is($q, q["quoted phrase"], 'quoted phrase'); + $q = $s->query_argv_to_string($g, ['s:pa ce']); + is($q, q[s:"pa ce"], 'space with prefix'); + $q = $s->query_argv_to_string($g, ["\(s:pa ce", "AND", "foo\)"]); + is($q, q[(s:"pa ce" AND foo)], 'space AND foo'); + local $ENV{TZ} = 'UTC'; my $now = strftime('%H:%M:%S', gmtime(time)); if ($now =~ /\A23:(?:59|60)/ || $now =~ /\A00:00:0[01]\z/) { skip 'too close to midnight, time is tricky', 6; } - my ($s, $g) = ($ibx->search, $ibx->git); - my $q = $s->query_argv_to_string($g, [qw(d:20101002 blah)]); + $q = $s->query_argv_to_string($g, [qw(d:20101002 blah)]); is($q, 'd:20101002..20101003 blah', 'YYYYMMDD expanded to range'); $q = $s->query_argv_to_string($g, [qw(d:2010-10-02)]); is($q, 'd:20101002..20101003', 'YYYY-MM-DD expanded to range'); |