aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2013-05-31 20:40:07 -0400
committerGravatar David Bremner <bremner@debian.org>2013-06-01 09:00:40 -0300
commit89efd5717ab26cf626ceb67964b9b4af8820e52c (patch)
tree834b8be79250fe7001254014ebdf4eb82a7c0e63 /test
parentb89ffba3012603d3eb9b1e144bf0a81480588ea3 (diff)
emacs: Use streaming S-expr parser for search
In addition to being the Right Thing to do, this noticeably improves the time taken to display the first page of search results, since it's roughly an order of magnitude faster than the JSON parser. Interestingly, it does *not* significantly improve the time to completely fill a large search buffer because for large search buffers, the cost of creating author invisibility overlays and inserting text (which slows down with more overlays) dominates. However, the time required to display the first page of results is generally more important to the user experience.
Diffstat (limited to 'test')
-rwxr-xr-xtest/emacs10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/emacs b/test/emacs
index e3cf4690..5bc3efcc 100755
--- a/test/emacs
+++ b/test/emacs
@@ -858,7 +858,7 @@ test_expect_success "Rendering HTML mail with images" \
test_begin_subtest "Search handles subprocess error exit codes"
cat > notmuch_fail <<EOF
#!/bin/sh
-echo This is output
+echo '()'
exit 1
EOF
chmod a+x notmuch_fail
@@ -873,21 +873,19 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
(test-output))"
sed -i -e 's/^\[.*\]$/[XXX]/' ERROR
test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\
-Error: Unexpected output from notmuch search:
-This is output
End of search results.
---
$PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)
---
[XXX]
$PWD/notmuch_fail exited with status 1
-command: $PWD/notmuch_fail search --format\=json --format-version\=1 --sort\=newest-first tag\:inbox
+command: $PWD/notmuch_fail search --format\=sexp --format-version\=1 --sort\=newest-first tag\:inbox
exit status: 1"
test_begin_subtest "Search handles subprocess warnings"
cat > notmuch_fail <<EOF
#!/bin/sh
-echo This is output
+echo '()'
echo This is a warning >&2
echo This is another warning >&2
exit 0
@@ -905,8 +903,6 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
(test-output))"
sed -i -e 's/^\[.*\]$/[XXX]/' ERROR
test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\
-Error: Unexpected output from notmuch search:
-This is output
End of search results.
---
This is a warning (see *Notmuch errors* for more details)