summaryrefslogtreecommitdiffstats
path: root/test/T220-reply.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-08-24 08:17:43 -0700
committerDavid Bremner <david@tethera.net>2021-09-04 17:07:19 -0700
commit2944d5913319056dfec5c23065932fd1c87a96f6 (patch)
treeb4f7711a7ee1cbb46f54dd2a4a711ebff2bb5472 /test/T220-reply.sh
parenta2e7af5b6986bca5a2bb2752f892cb86a9767b3c (diff)
CLI/{count, dump, reindex, reply, show}: enable sexp queries
The change in each case is to call notmuch_query_create_with_syntax, relying on the already inherited shared options. As a bonus we get improved error handling from the new query creation API. The remaining subcommand is 'tag', which is a bit trickier.
Diffstat (limited to 'test/T220-reply.sh')
-rwxr-xr-xtest/T220-reply.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/T220-reply.sh b/test/T220-reply.sh
index 2db36fef..4e9984d2 100755
--- a/test/T220-reply.sh
+++ b/test/T220-reply.sh
@@ -2,15 +2,14 @@
test_description="\"notmuch reply\" in several variations"
. $(dirname "$0")/test-lib.sh || exit 1
-test_begin_subtest "Basic reply"
add_message '[from]="Sender <sender@example.com>"' \
[to]=test_suite@notmuchmail.org \
[subject]=notmuch-reply-test \
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="basic reply test"'
-output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK)
-test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
+cat <<EOF > basic.expected
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <sender@example.com>
In-Reply-To: <${gen_msg_id}>
@@ -18,7 +17,19 @@ References: <${gen_msg_id}>
On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
> basic reply test
-OK"
+OK
+EOF
+
+test_begin_subtest "Basic reply"
+notmuch reply id:${gen_msg_id} >OUTPUT 2>&1 && echo OK >> OUTPUT
+test_expect_equal_file basic.expected OUTPUT
+
+if [ $NOTMUCH_HAVE_SFSEXP -eq 1 ]; then
+
+ test_begin_subtest "Basic reply (query=sexp)"
+ notmuch reply --query=sexp "(id ${gen_msg_id})" >OUTPUT 2>&1 && echo OK >> OUTPUT
+ test_expect_equal_file basic.expected OUTPUT
+fi
test_begin_subtest "Multiple recipients"
add_message '[from]="Sender <sender@example.com>"' \