aboutsummaryrefslogtreecommitdiff
path: root/test/T055-path-config.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-01-09 07:25:25 -0400
committerDavid Bremner <david@tethera.net>2021-03-20 07:42:06 -0300
commit2c879667b3c9d51eb23f53c040acce341d75920b (patch)
treeb81b441d36a462585eaa5072900c25dda728b18f /test/T055-path-config.sh
parent5ec6fd4dcfba0c50bcdec56b4ec51c2ccd1f2e92 (diff)
CLI/new: support split database and mail location
This adds new state variable for the mail root, and uses it most places db_path was used. The notable exception is dumps from backups. The latter will be dealt with properly in a future commit.
Diffstat (limited to 'test/T055-path-config.sh')
-rwxr-xr-xtest/T055-path-config.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 19a8a4ab..6df17f80 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -95,6 +95,47 @@ EOF
notmuch search --output=messages '*' > OUTPUT
test_expect_equal_file EXPECTED OUTPUT
+ test_begin_subtest "use existing database ($config)"
+ output=$(notmuch new)
+ test_expect_equal "$output" 'No new mail.'
+
+ test_begin_subtest "create database ($config)"
+ rm -rf $DATABASE_PATH/{.notmuch,}/xapian
+ notmuch new
+ output=$(notmuch count '*')
+ test_expect_equal "$output" '52'
+
+ test_begin_subtest "detect new files ($config)"
+ generate_message
+ generate_message
+ notmuch new
+ output=$(notmuch count '*')
+ test_expect_equal "$output" '54'
+
+ test_begin_subtest "Show a raw message ($config)"
+ add_message
+ notmuch show --format=raw id:$gen_msg_id > OUTPUT
+ test_expect_equal_file $gen_msg_filename OUTPUT
+ rm -f $gen_msg_filename
+
+ test_begin_subtest "reply ($config)"
+ 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"'
+ notmuch reply id:${gen_msg_id} 2>&1 > OUTPUT
+ cat <<EOF > 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}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
+> basic reply test
+EOF
+ test_expect_equal_file EXPECTED OUTPUT
restore_config
done