about summary refs log tree commit homepage
path: root/t/search.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-07 23:05:21 -1000
committerEric Wong <e@80x24.org>2021-02-08 22:07:50 +0000
commit29e530f1c0694107ad25881a2c693c30783f85f1 (patch)
tree5855eabccbdd1a8f5c2050ed52d49713f2be55df /t/search.t
parentecd4e2e20f1af200697e54c2a322a459cdf4c5fc (diff)
downloadpublic-inbox-29e530f1c0694107ad25881a2c693c30783f85f1.tar.gz
This matches the Inline::C version, and lets us test
argv overflow with $search->query_argv_to_string;
Diffstat (limited to 't/search.t')
-rw-r--r--t/search.t7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/search.t b/t/search.t
index 56c7db1c..36a8fb30 100644
--- a/t/search.t
+++ b/t/search.t
@@ -576,6 +576,13 @@ SKIP: {
         $q = $s->query_argv_to_string($g, [qw{OR (rt:1993-10-02)}]);
         like($q, qr/\AOR \(rt:749\d{6}\.\.749\d{6}\)\z/,
                 'trailing parentheses preserved');
+        $ENV{TEST_EXPENSIVE} or
+                skip 'TEST_EXPENSIVE not set for argv overflow check', 1;
+        my @w;
+        local $SIG{__WARN__} = sub { push @w, @_ }; # for pure Perl version
+        my @fail = map { 'd:1993-10-02..2010-10-02' } (1..(4096 * 32));
+        eval { $s->query_argv_to_string($g, \@fail) };
+        ok($@, 'exception raised');
 }
 
 done_testing();