aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-02-23 16:19:13 -0400
committerDavid Bremner <david@tethera.net>2021-03-27 09:26:14 -0300
commit217f8196088f200972d35ee9181bfe361cccc04a (patch)
treec6f6ceba6c51fbf7daaced601cccbaa057fadbce /test
parent2e39ce6eb5d5e5ae2a2a4ed419190003f47e566e (diff)
CLI+lib: detect missing database in split configurations.
Eventually we want to do all opening of databases in the top level (main function). This means that detection of missing databases needs to move out of subcommands. It also requires updating the library to use the new NO_DATABASE status code.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T040-setup.sh7
-rwxr-xr-xtest/T055-path-config.sh16
2 files changed, 18 insertions, 5 deletions
diff --git a/test/T040-setup.sh b/test/T040-setup.sh
index daeca3e4..42c621c8 100755
--- a/test/T040-setup.sh
+++ b/test/T040-setup.sh
@@ -26,11 +26,8 @@ test_expect_equal_file ${expected_dir}/config-with-comments new-notmuch-config
test_begin_subtest "notmuch with a config but without a database suggests notmuch new"
notmuch 2>&1 | notmuch_dir_sanitize > OUTPUT
cat <<EOF > EXPECTED
-Notmuch is configured, but there's not yet a database at
-
- MAIL_DIR/.notmuch
-
-You probably want to run "notmuch new" now to create that database.
+Notmuch is configured, but no database was found.
+You probably want to run "notmuch new" now to create a database.
Note that the first run of "notmuch new" can take a very long time
and that the resulting database will use roughly the same amount of
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index d8828342..0a34e67f 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -199,6 +199,22 @@ EOF
"$output" \
"Welcome to a new version of notmuch! Your database will now be upgraded."
+ test_begin_subtest "notmuch +config -database suggests notmuch new ($config)"
+ mv "$XAPIAN_PATH" "${XAPIAN_PATH}.bak"
+ notmuch > OUTPUT
+cat <<EOF > EXPECTED
+Notmuch is configured, but no database was found.
+You probably want to run "notmuch new" now to create a database.
+
+Note that the first run of "notmuch new" can take a very long time
+and that the resulting database will use roughly the same amount of
+storage space as the email being indexed.
+
+EOF
+ mv "${XAPIAN_PATH}.bak" "$XAPIAN_PATH"
+
+ test_expect_equal_file EXPECTED OUTPUT
+
restore_config
done