aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/emacs15
-rwxr-xr-xtest/emacs-show10
-rw-r--r--test/test-lib.sh11
3 files changed, 24 insertions, 12 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"
diff --git a/test/emacs-show b/test/emacs-show
index fb23db4d..ec863334 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -181,14 +181,14 @@ 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 ===
+=== MESSAGES ===
This is an error (see *Notmuch errors* for more details)
----
+=== ERROR ===
[XXX]
This is an error
-command: $PWD/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\'
+command: YYY/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\'
exit status: 1
stderr:
This is an error
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2aa4dfc9..8611ba5e 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -628,6 +628,17 @@ notmuch_json_show_sanitize ()
-e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'
}
+notmuch_emacs_error_sanitize ()
+{
+ local command=$1
+ shift
+ for file in "$@"; do
+ echo "=== $file ==="
+ cat "$file"
+ done | sed \
+ -e 's/^\[.*\]$/[XXX]/' \
+ -e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|"
+}
# End of notmuch helper functions
# Use test_set_prereq to tell that a particular prerequisite is available.