]> git.cworth.org Git - notmuch/blobdiff - test/T055-path-config.sh
test: add test for creating database in various configurations.
[notmuch] / test / T055-path-config.sh
index 4897c8142ac73ea47023744cafcfd966985f1a98..45545d885182afd9095ff8925a20203057d48c03 100755 (executable)
@@ -313,6 +313,12 @@ user.other_email
 user.primary_email
 EOF
    test_expect_equal_file EXPECTED OUTPUT
+
+   test_begin_subtest "create database ($config)"
+   rm -r ${XAPIAN_PATH}
+   notmuch new
+   test_expect_equal "$(xapian-metadata get ${XAPIAN_PATH} version)" 3
+
    case $config in
        XDG*)
           test_begin_subtest "Set shadowed config value in database ($config)"
@@ -336,6 +342,17 @@ db=Database(config=Database.CONFIG.SEARCH)
 m=db.find('20091117232137.GA7669@griffis1.net')
 to=m.header('To')
 print(to)
+EOF
+          test_expect_equal_file EXPECTED OUTPUT
+
+          test_begin_subtest ".notmuch not ignored in split config ($config)"
+          test_subtest_known_broken
+          generate_message '[dir]=.notmuch/cur' '[subject]="Do not ignore, very important"'
+          NOTMUCH_NEW > OUTPUT
+          notmuch search subject:Do-not-ignore | notmuch_search_sanitize >> OUTPUT
+          cat <<EOF > EXPECTED
+Added 1 new message to the database.
+thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Do not ignore, very important (inbox unread)
 EOF
           test_expect_equal_file EXPECTED OUTPUT
           ;;
@@ -348,9 +365,6 @@ EOF
           ;;
    esac
 
-   case $config in
-       split|XDG*)
-   esac
    restore_config
    rm -rf home/.local
    rm -rf home/.config