aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/emacs
diff options
context:
space:
mode:
authorGravatar David Bremner <david@tethera.net>2013-11-23 07:01:16 -0400
committerGravatar David Bremner <david@tethera.net>2013-11-23 20:25:29 -0400
commit2560996b7ebb08cca7e20fbb182998bc2e0e2151 (patch)
tree02de6fe2a830465e39b8c53b201792cb4fd415bc /test/emacs
parent9c25d4bbf02d8c1902f1c166125afaf93419c3d7 (diff)
test: replace $PWD with YYY in emacs & emacs-show tests
When executed command line is written to *Notmuch errors* buffer, shell-quote-argument will backslash-escape any char that is not in "POSIX filename characters" (i.e. matching "[^-0-9a-zA-Z_./\n]"). Currently in two emacs tests shell has expanded $PWD as part of emacs variable, which will later be fed to #'shell-quote-argument and finally written to ERROR file. If $PWD contained non-POSIX filename characters, data in ERROR file will not match $PWD when later comparing in shell. Therefore, in these two particular cases the escaped $PWD is replaced with YYY in ERROR file and expected content is adjusted accordingly.
Diffstat (limited to 'test/emacs')
-rwxr-xr-xtest/emacs15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/emacs b/test/emacs
index 3b3b14d7..456435c1 100755
--- a/test/emacs
+++ b/test/emacs
@@ -881,15 +881,16 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
(with-current-buffer \"*Notmuch errors*\"
(test-output \"ERROR\"))
(test-output))"
-sed -i -e 's/^\[.*\]$/[XXX]/' ERROR
-test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\
+
+test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES ERROR)" "\
+=== OUTPUT ===
End of search results.
----
-$PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)
----
+=== MESSAGES ===
+YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)
+=== ERROR ===
[XXX]
-$PWD/notmuch_fail exited with status 1
-command: $PWD/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox
+YYY/notmuch_fail exited with status 1
+command: YYY/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox
exit status: 1"
test_begin_subtest "Search handles subprocess warnings"