diff options
| author | David Bremner <david@tethera.net> | 2021-05-10 11:36:56 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-05-10 11:36:56 -0300 |
| commit | b4a4ed0df9cd2150e75853f5491cfa02fe72caf1 (patch) | |
| tree | 0090f337227ba5d2e06966f8074c540aea914d66 /test | |
| parent | ac64de450a4d61c49fef509ce376fc4d096bb5b5 (diff) | |
| parent | 5ebbf17242522e3a00d7f084f0ddfc86b0611825 (diff) | |
Merge branch 'release'
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T030-config.sh | 6 | ||||
| -rwxr-xr-x | test/T050-new.sh | 24 | ||||
| -rwxr-xr-x | test/T400-hooks.sh | 7 | ||||
| -rwxr-xr-x | test/T530-upgrade.sh | 19 |
4 files changed, 52 insertions, 4 deletions
diff --git a/test/T030-config.sh b/test/T030-config.sh index b22d8f29..7a1660e9 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -117,12 +117,12 @@ test_expect_equal "$(notmuch config get database.path)" \ ln -s `pwd`/mail home/Maildir add_email_corpus -test_begin_subtest "Relative database path expanded in open" +test_begin_subtest "Relative database path expanded" notmuch config set database.path Maildir -path=$(notmuch config get database.path) +path=$(notmuch config get database.path | notmuch_dir_sanitize) count=$(notmuch count '*') test_expect_equal "${path} ${count}" \ - "Maildir 52" + "CWD/home/Maildir 52" test_begin_subtest "Add config to database" notmuch new diff --git a/test/T050-new.sh b/test/T050-new.sh index 2985e24c..4beae379 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -394,6 +394,30 @@ exit status: 75 EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Relative database path expanded in new" +ln -s "$PWD/mail" home/Maildir +notmuch config set database.path Maildir +generate_message +NOTMUCH_NEW > OUTPUT +cat <<EOF >EXPECTED +Added 1 new message to the database. +EOF +notmuch config set database.path ${MAIL_DIR} +rm home/Maildir +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "Relative mail root (in db) expanded in new" +ln -s "$PWD/mail" home/Maildir +notmuch config set --database database.mail_root Maildir +generate_message +NOTMUCH_NEW > OUTPUT +cat <<EOF >EXPECTED +Added 1 new message to the database. +EOF +notmuch config set database.mail_root +rm home/Maildir +test_expect_equal_file EXPECTED OUTPUT + add_email_corpus broken test_begin_subtest "reference loop does not crash" test_expect_code 0 "notmuch show --format=json id:mid-loop-12@example.org id:mid-loop-21@example.org > OUTPUT" diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh index 3a2df2f4..00c99337 100755 --- a/test/T400-hooks.sh +++ b/test/T400-hooks.sh @@ -43,7 +43,7 @@ add_message # create maildir structure for notmuch-insert mkdir -p "$MAIL_DIR"/{cur,new,tmp} -for config in traditional profile explicit XDG split; do +for config in traditional profile explicit relative XDG split; do unset NOTMUCH_PROFILE notmuch config set database.hook_dir notmuch config set database.path ${MAIL_DIR} @@ -63,6 +63,11 @@ for config in traditional profile explicit XDG split; do mkdir -p $HOOK_DIR notmuch config set database.hook_dir $HOOK_DIR ;; + relative) + HOOK_DIR=${HOME}/.notmuch-hooks + mkdir -p $HOOK_DIR + notmuch config set database.hook_dir .notmuch-hooks + ;; XDG) HOOK_DIR=${HOME}/.config/notmuch/default/hooks ;; diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh index cce29f45..5f0de2ed 100755 --- a/test/T530-upgrade.sh +++ b/test/T530-upgrade.sh @@ -54,4 +54,23 @@ for key in 'from/subject/message-ID in database' \ restore_database done +test_begin_subtest "upgrade with configured backup dir" +notmuch config set database.backup_dir ${HOME}/backups +delete_feature 'modification tracking' +notmuch new | grep Backing | notmuch_dir_sanitize | sed 's/dump-[0-9T]*/dump-XXX/' > OUTPUT +cat <<EOF > EXPECTED +Backing up tags to CWD/home/backups/dump-XXX.gz... +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "upgrade with relative configured backup dir" +notmuch config set database.backup_dir ${HOME}/backups +delete_feature 'modification tracking' +notmuch new | grep Backing | notmuch_dir_sanitize | sed 's/dump-[0-9T]*/dump-XXX/' > OUTPUT +cat <<EOF > EXPECTED +Backing up tags to CWD/home/backups/dump-XXX.gz... +EOF +test_expect_equal_file EXPECTED OUTPUT + + test_done |
