]> git.notmuchmail.org Git - notmuch/commitdiff
test: add known_broken test for dumping large stored queries
authorDavid Bremner <david@tethera.net>
Sun, 12 Apr 2020 17:30:12 +0000 (14:30 -0300)
committerDavid Bremner <david@tethera.net>
Mon, 13 Apr 2020 12:35:14 +0000 (09:35 -0300)
'qsx' reported a bug on #notmuch with notmuch-dump and large stored
queries. This test will pass (on my machine) if the value of `repeat'
is made smaller.

Reported-By: Thomas Schneider <qsx@chaotikum.eu>
test/T600-named-queries.sh

index abaee3b7ca4c7d7165d1bf42df806694ab56156d..852f75305589a6b62c678f3236eef8da0d5352b3 100755 (executable)
@@ -36,6 +36,22 @@ cat<<EOF > QUERIES.BEFORE
 EOF
 test_expect_equal_file QUERIES.BEFORE OUTPUT
 
+test_begin_subtest 'dumping large queries'
+test_subtest_known_broken
+# This value is just large enough to trigger a limitation of gzprintf
+# to 8191 bytes in total (by default).
+repeat=1329
+notmuch config set query.big "$(seq -s' ' $repeat)"
+notmuch dump --include=config > OUTPUT
+notmuch config set query.big ''
+printf "#notmuch-dump batch-tag:3 config\n#@ query.big " > EXPECTED
+seq -s'%20' $repeat >> EXPECTED
+cat <<EOF >> EXPECTED
+#@ query.test date%3a2009-11-18..2009-11-18%20and%20tag%3aunread
+#@ query.test2 query%3atest%20and%20subject%3aMaildir
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_begin_subtest "delete named queries"
 notmuch dump > BEFORE
 notmuch config set query.test