]> git.cworth.org Git - notmuch-old/blobdiff - test/T055-path-config.sh
test: add test for creating database in various configurations.
[notmuch-old] / test / T055-path-config.sh
index 71823039f97ef2d100b307e0f3255bf32a557d2e..45545d885182afd9095ff8925a20203057d48c03 100755 (executable)
@@ -294,7 +294,6 @@ EOF
    test_expect_equal_file EXPECTED OUTPUT
 
    test_begin_subtest "Config list from python ($config)"
-   test_subtest_known_broken
    test_python <<EOF > OUTPUT
 from notmuch2 import Database
 db=Database(config=Database.CONFIG.SEARCH)
@@ -314,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)"
@@ -337,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
           ;;
@@ -349,9 +365,6 @@ EOF
           ;;
    esac
 
-   case $config in
-       split|XDG*)
-   esac
    restore_config
    rm -rf home/.local
    rm -rf home/.config