[PATCH 2/2] test: show tests
Mark Walters
markwalters1009 at gmail.com
Mon Mar 19 08:31:01 PDT 2012
---
test/notmuch-test | 1 +
test/show | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)
create mode 100755 test/show
diff --git a/test/notmuch-test b/test/notmuch-test
index f03b594..2499e4b 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -28,6 +28,7 @@ TESTS="
search-insufficient-from-quoting
search-limiting
tagging
+ show
json
multipart
thread-naming
diff --git a/test/show b/test/show
new file mode 100755
index 0000000..fc83e5e
--- /dev/null
+++ b/test/show
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+test_description='"notmuch show" in several variations'
+. ./test-lib.sh
+
+EXPECTED=$TEST_DIRECTORY/show.expected-output
+
+add_email_corpus
+
+thread_query=`notmuch search --output=threads subject:"Working with Maildir storage?"`
+
+test_begin_subtest "Show single thread (text)"
+notmuch show $thread_query >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-text
+
+test_begin_subtest "Show single thread (json)"
+notmuch show --format=json $thread_query | notmuch_json_show_sanitize >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-json
+
+test_begin_subtest "Show single thread (mbox)"
+notmuch show --format=mbox $thread_query >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-mbox
+
+test_begin_subtest "Show single thread with additional query (text)"
+notmuch show $thread_query and from:worth >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-text
+
+test_begin_subtest "Show single thread with additional query --entire-thread (text)"
+notmuch show --entire-thread $thread_query and from:worth >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-entire-thread-text
+
+test_begin_subtest "Show single thread with additional query (json)"
+notmuch show --format=json $thread_query and from:worth | notmuch_json_show_sanitize >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-json
+
+test_begin_subtest "Show single thread with additional query --entire-thread (json)"
+notmuch show --format=json --entire-thread $thread_query and from:worth | notmuch_json_show_sanitize >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-entire-thread-json
+
+test_begin_subtest "Show single thread with additional query (mbox)"
+notmuch show --format=mbox $thread_query and from:worth >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-mbox
+
+test_begin_subtest "Show single thread with additional query --entire-thread (mbox)"
+notmuch show --format=mbox --entire-thread $thread_query and from:worth >OUTPUT
+test_expect_equal_file OUTPUT $EXPECTED/single-thread-and-query-entire-thread-mbox
+
+test_done
--
1.7.9.1
More information about the notmuch
mailing list