From ba9f9efc9a8ba9d6e509d4041a66e9a2d31171b1 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 20 Sep 2010 16:13:15 -0700 Subject: [PATCH] test: Remove useless NOTMUCH variable (in favor of simply "notmuch") When the NOTMUCH variable was originally invented it was used as an explicit path to the notmuch binary being tested. Today, the test suite sets the PATH variable instead, so the NOTMUCH variable always has a value of simply "notmuch". We simplifying that by using the constant value rather than the continual variable reference. --- test/author-order | 8 ++++---- test/dump-restore | 12 ++++++------ test/encoding | 2 +- test/from-guessing | 20 ++++++++++---------- test/json | 10 +++++----- test/long-id | 2 +- test/new | 6 +++--- test/reply | 14 +++++++------- test/search | 34 +++++++++++++++++----------------- test/test-lib.sh | 2 -- test/thread-naming | 20 ++++++++++---------- test/thread-order | 6 +++--- test/uuencode | 6 +++--- 13 files changed, 70 insertions(+), 72 deletions(-) diff --git a/test/author-order b/test/author-order index d618b858..9f0b9316 100755 --- a/test/author-order +++ b/test/author-order @@ -18,19 +18,19 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Searching when all three messages match" -output=$($NOTMUCH search findme | notmuch_search_sanitize) +output=$(notmuch search findme | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)" test_begin_subtest "Searching when two messages match" -output=$($NOTMUCH search User1 or User2 | notmuch_search_sanitize) +output=$(notmuch search User1 or User2 | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)" test_begin_subtest "Searching when only one message matches" -output=$($NOTMUCH search User2 | notmuch_search_sanitize) +output=$(notmuch search User2 | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)" test_begin_subtest "Searching when only first message matches" -output=$($NOTMUCH search User | notmuch_search_sanitize) +output=$(notmuch search User | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)" test_done diff --git a/test/dump-restore b/test/dump-restore index 21f91055..466f363d 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -4,19 +4,19 @@ test_description="\"notmuch dump\" and \"notmuch restore\"" test_expect_success "Dumping all tags" "generate_message && notmuch new && -$NOTMUCH dump dump.expected" +notmuch dump dump.expected" test_begin_subtest "Clearing all tags" sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected -$NOTMUCH restore clear.expected -$NOTMUCH dump clear.actual +notmuch restore clear.expected +notmuch dump clear.actual test_expect_equal "$(< clear.actual)" "$(< clear.expected)" test_begin_subtest "Restoring original tags" -$NOTMUCH restore dump.expected -$NOTMUCH dump dump.actual +notmuch restore dump.expected +notmuch dump dump.actual test_expect_equal "$(< dump.actual)" "$(< dump.expected)" -test_expect_success "Restore with nothing to do" "$NOTMUCH restore dump.expected" +test_expect_success "Restore with nothing to do" "notmuch restore dump.expected" test_done diff --git a/test/encoding b/test/encoding index 6a7196be..68cb8ee8 100755 --- a/test/encoding +++ b/test/encoding @@ -5,7 +5,7 @@ test_description="encoding issues" test_begin_subtest "Message with text of unknown charset" add_message '[content-type]="text/plain; charset=unknown-8bit"' \ "[body]=irrelevant" -output=$($NOTMUCH show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +output=$(notmuch show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) test_expect_equal "$output" " message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001 header{ Notmuch Test Suite (2001-01-05) (inbox unread) diff --git a/test/from-guessing b/test/from-guessing index 613917c9..fab2007f 100755 --- a/test/from-guessing +++ b/test/from-guessing @@ -9,7 +9,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -28,7 +28,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -47,7 +47,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -68,7 +68,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -89,7 +89,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -111,7 +111,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -130,7 +130,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -149,7 +149,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -170,7 +170,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org @@ -191,7 +191,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org diff --git a/test/json b/test/json index 24976131..7fe2a27a 100755 --- a/test/json +++ b/test/json @@ -4,12 +4,12 @@ test_description="--format=json output" test_begin_subtest "Show message: json" add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\"" -output=$($NOTMUCH show --format=json "json-show-message") +output=$(notmuch show --format=json "json-show-message") test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]" test_begin_subtest "Search message: json" add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\"" -output=$($NOTMUCH search --format=json "json-search-message" | notmuch_search_sanitize) +output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize) test_expect_equal "$output" "[{\"thread\": \"XXX\", \"timestamp\": 946728000, \"matched\": 1, @@ -20,17 +20,17 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\", test_begin_subtest "Search by subject (utf-8):" add_message [subject]=utf8-sübjéct "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" -output=$($NOTMUCH search subject:utf8-sübjéct | notmuch_search_sanitize) +output=$(notmuch search subject:utf8-sübjéct | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread)" test_begin_subtest "Show message: json, utf-8" add_message "[subject]=\"json-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\"" -output=$($NOTMUCH show --format=json "jsön-show-méssage") +output=$(notmuch show --format=json "jsön-show-méssage") test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-utf8-body-sübjéct\", \"From\": \"Notmuch Test Suite \", \"To\": \"Notmuch Test Suite \", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"jsön-show-méssage\n\"}]}, []]]]" test_begin_subtest "Search message: json, utf-8" add_message "[subject]=\"json-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\"" -output=$($NOTMUCH search --format=json "jsön-search-méssage" | notmuch_search_sanitize) +output=$(notmuch search --format=json "jsön-search-méssage" | notmuch_search_sanitize) test_expect_equal "$output" "[{\"thread\": \"XXX\", \"timestamp\": 946728000, \"matched\": 1, diff --git a/test/long-id b/test/long-id index 202a0321..84f92943 100755 --- a/test/long-id +++ b/test/long-id @@ -21,7 +21,7 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Ensure all messages were threaded together" -output=$($NOTMUCH search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) +output=$(notmuch search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/3] Notmuch Test Suite; A ridiculously-long message ID (inbox unread)" test_done diff --git a/test/new b/test/new index 4c6952fd..7b396ae4 100755 --- a/test/new +++ b/test/new @@ -53,7 +53,7 @@ tmp_msg_filename=tmp/"$gen_msg_filename" mkdir -p "$(dirname "$tmp_msg_filename")" mv "$gen_msg_filename" "$tmp_msg_filename" increment_mtime "${MAIL_DIR}" -$NOTMUCH new > /dev/null +notmuch new > /dev/null mv "$tmp_msg_filename" "$gen_msg_filename" increment_mtime "${MAIL_DIR}" output=$(NOTMUCH_NEW) @@ -63,7 +63,7 @@ test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Renamed message" generate_message -$NOTMUCH new > /dev/null +notmuch new > /dev/null mv "$gen_msg_filename" "${gen_msg_filename}"-renamed increment_mtime "${MAIL_DIR}" output=$(NOTMUCH_NEW) @@ -84,7 +84,7 @@ generate_message [dir]=dir generate_message [dir]=dir generate_message [dir]=dir -$NOTMUCH new > /dev/null +notmuch new > /dev/null mv "${MAIL_DIR}"/dir "${MAIL_DIR}"/dir-renamed increment_mtime "${MAIL_DIR}" diff --git a/test/reply b/test/reply index d6b74317..9f6442b7 100755 --- a/test/reply +++ b/test/reply @@ -9,7 +9,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="basic reply test"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender @@ -27,7 +27,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="Multiple recipients"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , Someone Else @@ -46,7 +46,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="reply with CC"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender @@ -65,7 +65,7 @@ add_message '[from]="Sender "' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="reply from alternate address"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender @@ -84,7 +84,7 @@ add_message '[from]="Sender "' \ '[body]="support for reply-to"' \ '[reply-to]="Sender "' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender @@ -103,7 +103,7 @@ add_message '[from]="Sender "' \ '[body]="Un-munging Reply-To"' \ '[reply-to]="Evil Munging List "' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , Some List @@ -118,7 +118,7 @@ test_begin_subtest "Message with header of exactly 200 bytes" add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="200-byte header"' -output=$($NOTMUCH reply id:${gen_msg_id}) +output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces Bcc: test_suite@notmuchmail.org diff --git a/test/search b/test/search index 865f5bb6..32799c40 100755 --- a/test/search +++ b/test/search @@ -4,75 +4,75 @@ test_description='"notmuch search" in several variations' test_begin_subtest "Search body" add_message '[subject]="body search"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [body]=bodysearchtest -output=$($NOTMUCH search bodysearchtest | notmuch_search_sanitize) +output=$(notmuch search bodysearchtest | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)" test_begin_subtest "Search by from:" add_message '[subject]="search by from"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom -output=$($NOTMUCH search from:searchbyfrom | notmuch_search_sanitize) +output=$(notmuch search from:searchbyfrom | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)" test_begin_subtest "Search by to:" add_message '[subject]="search by to"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto -output=$($NOTMUCH search to:searchbyto | notmuch_search_sanitize) +output=$(notmuch search to:searchbyto | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)" test_begin_subtest "Search by subject:" add_message [subject]=subjectsearchtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$($NOTMUCH search subject:subjectsearchtest | notmuch_search_sanitize) +output=$(notmuch search subject:subjectsearchtest | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread)" test_begin_subtest "Search by id:" add_message '[subject]="search by id"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$($NOTMUCH search id:${gen_msg_id} | notmuch_search_sanitize) +output=$(notmuch search id:${gen_msg_id} | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread)" test_begin_subtest "Search by tag:" add_message '[subject]="search by tag"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -$NOTMUCH tag +searchbytag id:${gen_msg_id} -output=$($NOTMUCH search tag:searchbytag | notmuch_search_sanitize) +notmuch tag +searchbytag id:${gen_msg_id} +output=$(notmuch search tag:searchbytag | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread)" test_begin_subtest "Search by thread:" add_message '[subject]="search by thread"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -thread_id=$($NOTMUCH search id:${gen_msg_id} | sed -e "s/thread:\([a-f0-9]*\).*/\1/") -output=$($NOTMUCH search thread:${thread_id} | notmuch_search_sanitize) +thread_id=$(notmuch search id:${gen_msg_id} | sed -e "s/thread:\([a-f0-9]*\).*/\1/") +output=$(notmuch search thread:${thread_id} | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread)" test_begin_subtest "Search body (phrase)" add_message '[subject]="body search (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="body search (phrase)"' add_message '[subject]="negative result"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="This phrase should not match the body search"' -output=$($NOTMUCH search '"body search (phrase)"' | notmuch_search_sanitize) +output=$(notmuch search '"body search (phrase)"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread)" test_begin_subtest "Search by from: (address)" add_message '[subject]="search by from (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom@example.com -output=$($NOTMUCH search from:searchbyfrom@example.com | notmuch_search_sanitize) +output=$(notmuch search from:searchbyfrom@example.com | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (address) (inbox unread)" test_begin_subtest "Search by from: (name)" add_message '[subject]="search by from (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]="Search By From Name "' -output=$($NOTMUCH search from:"Search By From Name" | notmuch_search_sanitize) +output=$(notmuch search from:"Search By From Name" | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)" test_begin_subtest "Search by to: (address)" add_message '[subject]="search by to (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto@example.com -output=$($NOTMUCH search to:searchbyto@example.com | notmuch_search_sanitize) +output=$(notmuch search to:searchbyto@example.com | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (inbox unread)" test_begin_subtest "Search by to: (name)" add_message '[subject]="search by to (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[to]="Search By To Name "' -output=$($NOTMUCH search to:"Search By To Name" | notmuch_search_sanitize) +output=$(notmuch search to:"Search By To Name" | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)" test_begin_subtest "Search by subject: (phrase)" add_message '[subject]="subject search test (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' add_message '[subject]="this phrase should not match the subject search test"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$($NOTMUCH search 'subject:"subject search test (phrase)"' | notmuch_search_sanitize) +output=$(notmuch search 'subject:"subject search test (phrase)"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread)" test_begin_subtest 'Search for all messages ("*" -output=$($NOTMUCH search '*' | notmuch_search_sanitize) +output=$(notmuch search '*' | notmuch_search_sanitize) test_expect_equal):' "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread) thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread) @@ -91,7 +91,7 @@ thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not match t test_begin_subtest "Search body (utf-8):" add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="message body utf8: bödý"' -output=$($NOTMUCH search "bödý" | notmuch_search_sanitize) +output=$(notmuch search "bödý" | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)" test_done diff --git a/test/test-lib.sh b/test/test-lib.sh index 7a4931d2..559a5435 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -396,8 +396,6 @@ test_expect_equal () fi } -NOTMUCH=notmuch - NOTMUCH_NEW () { notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file' diff --git a/test/thread-naming b/test/thread-naming index 31c01532..129536e0 100755 --- a/test/thread-naming +++ b/test/thread-naming @@ -19,54 +19,54 @@ add_message '[subject]="thread-naming: Final thread subject"' \ final=${gen_msg_id} test_begin_subtest "Initial thread name (oldest-first search)" -output=$($NOTMUCH search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" test_begin_subtest "Initial thread name (newest-first search)" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)" # Remove oldest and newest messages from search results -$NOTMUCH tag -inbox id:$parent or id:$final +notmuch tag -inbox id:$parent or id:$final test_begin_subtest "Changed thread name (oldest-first search)" -output=$($NOTMUCH search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)" test_begin_subtest "Changed thread name (newest-first search)" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)" test_begin_subtest "Ignore added reply prefix (Re:)" add_message '[subject]="Re: thread-naming: Initial thread subject"' \ '[date]="Tue, 09 Jan 2001 15:43:45 -0000"' \ "[in-reply-to]=\<$parent\>" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" test_begin_subtest "Ignore added reply prefix (Aw:)" add_message '[subject]="Aw: thread-naming: Initial thread subject"' \ '[date]="Wed, 10 Jan 2001 15:43:45 -0000"' \ "[in-reply-to]=\<$parent\>" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" test_begin_subtest "Ignore added reply prefix (Vs:)" add_message '[subject]="Vs: thread-naming: Initial thread subject"' \ '[date]="Thu, 11 Jan 2001 15:43:45 -0000"' \ "[in-reply-to]=\<$parent\>" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" test_begin_subtest "Ignore added reply prefix (Sv:)" add_message '[subject]="Sv: thread-naming: Initial thread subject"' \ '[date]="Fri, 12 Jan 2001 15:43:45 -0000"' \ "[in-reply-to]=\<$parent\>" -output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) +output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" test_begin_subtest 'Test order of messages in "notmuch show"' -output=$($NOTMUCH show thread-naming | notmuch_show_sanitize) +output=$(notmuch show thread-naming | notmuch_show_sanitize) test_expect_equal "$output" " message{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first) header{ Notmuch Test Suite (2001-01-05) (unread) diff --git a/test/thread-order b/test/thread-order index 47f25c86..1819fce3 100755 --- a/test/thread-order +++ b/test/thread-order @@ -8,7 +8,7 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Searching returns the message" -output=$($NOTMUCH search foo | notmuch_search_sanitize) +output=$(notmuch search foo | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)" test_begin_subtest "Adding second child message" @@ -17,7 +17,7 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Searching returns both messages in one thread" -output=$($NOTMUCH search foo | notmuch_search_sanitize) +output=$(notmuch search foo | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)" test_begin_subtest "Adding parent message" @@ -26,7 +26,7 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Searching returns all three messages in one thread" -output=$($NOTMUCH search foo | notmuch_search_sanitize) +output=$(notmuch search foo | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)" test_done diff --git a/test/uuencode b/test/uuencode index 3592d5cc..d5093209 100755 --- a/test/uuencode +++ b/test/uuencode @@ -20,15 +20,15 @@ end Finally, we have our afteruudata marker as well."' test_begin_subtest "Ensure content before uu data is indexed" -output=$($NOTMUCH search beforeuudata | notmuch_search_sanitize) +output=$(notmuch search beforeuudata | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)" test_begin_subtest "Ensure uu data is not indexed" -output=$($NOTMUCH search DURINGUUDATA | notmuch_search_sanitize) +output=$(notmuch search DURINGUUDATA | notmuch_search_sanitize) test_expect_equal "$output" "" test_begin_subtest "Ensure content after uu data is indexed" -output=$($NOTMUCH search afteruudata | notmuch_search_sanitize) +output=$(notmuch search afteruudata | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)" test_done -- 2.43.0