X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT590-libconfig.sh;h=745e1bb4c491ac7f7a2b2fe1e3aa4983d0ec80bd;hb=b3258244c84a7673db39c46cad96ddb63b131dae;hp=edbba6c47f753b58f5152c4463016670a7e9ed95;hpb=0c6db22930b58fcea972e71b45f7ea0e6055ed20;p=notmuch diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index edbba6c4..745e1bb4 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -384,6 +384,9 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} '' %NULL% } } EOF + +notmuch_passwd_sanitize < OUTPUT > OUTPUT.clean + cat <<'EOF' >EXPECTED == stdout == MAIL_DIR @@ -391,16 +394,16 @@ MAIL_DIR MAIL_DIR/.notmuch/hooks MAIL_DIR/.notmuch/backups -inbox;unread -NULL +unread;inbox + true +USERNAME@FQDN NULL -NULL -NULL +USER_FULL_NAME == stderr == EOF unset MAILDIR -test_expect_equal_file EXPECTED OUTPUT +test_expect_equal_file EXPECTED OUTPUT.clean backup_database test_begin_subtest "override config from \${NOTMUCH_CONFIG}" @@ -543,8 +546,8 @@ cat <<'EOF' >EXPECTED == stdout == == stderr == error opening database -Something went wrong trying to read or write a file -Error: Cannot open database at CWD/home/.local/share/notmuch/default: No such file or directory. +No database found +Error: could not locate database. EOF test_expect_equal_file EXPECTED OUTPUT @@ -623,9 +626,6 @@ EOF test_begin_subtest "notmuch_database_get_config (ndlc)" -echo NOTMUCH_CONFIG=$NOTMUCH_CONFIG -echo NOTMUCH_PROFILE=$NOTMUCH_PROFILE -echo HOME=$HOME cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} %NULL% %NULL% { EXPECT0(notmuch_database_get_config (db, "test.key1", &val)); @@ -705,7 +705,7 @@ MAIL_DIR MAIL_DIR/.notmuch/hooks MAIL_DIR/.notmuch/backups foo;bar;fub -unread;inbox; +unread;inbox sekrit_junk true test_suite@notmuchmail.org @@ -727,6 +727,8 @@ cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} /nonexistent %NULL% } } EOF + +notmuch_passwd_sanitize < OUTPUT > OUTPUT.clean cat <<'EOF' >EXPECTED == stdout == MAIL_DIR @@ -734,15 +736,15 @@ MAIL_DIR MAIL_DIR/.notmuch/hooks MAIL_DIR/.notmuch/backups -inbox;unread -NULL +unread;inbox + true +USERNAME@FQDN NULL -NULL -NULL +USER_FULL_NAME == stderr == EOF -test_expect_equal_file EXPECTED OUTPUT +test_expect_equal_file EXPECTED OUTPUT.clean backup_database test_begin_subtest "override config from \${HOME}/.notmuch-config (ndlc)" @@ -770,5 +772,59 @@ EOF test_expect_equal_file EXPECTED OUTPUT restore_database +test_begin_subtest "notmuch_config_get_pairs: prefix (ndlc)" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} ${NOTMUCH_CONFIG} %NULL% +{ + notmuch_config_pairs_t *list; + for (list = notmuch_config_get_pairs (db, "user."); + notmuch_config_pairs_valid (list); + notmuch_config_pairs_move_to_next (list)) { + printf("%s %s\n", notmuch_config_pairs_key (list), notmuch_config_pairs_value(list)); + } + notmuch_config_pairs_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +user.name Notmuch Test Suite +user.other_email test_suite_other@notmuchmail.org;test_suite@otherdomain.org +user.primary_email test_suite@notmuchmail.org +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch_config_get_pairs: all pairs (ndlc)" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} ${NOTMUCH_CONFIG} %NULL% +{ + notmuch_config_pairs_t *list; + for (list = notmuch_config_get_pairs (db, ""); + notmuch_config_pairs_valid (list); + notmuch_config_pairs_move_to_next (list)) { + printf("%s %s\n", notmuch_config_pairs_key (list), notmuch_config_pairs_value(list)); + } + notmuch_config_pairs_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +aaabefore beforeval +database.backup_dir MAIL_DIR/.notmuch/backups +database.hook_dir MAIL_DIR/.notmuch/hooks +database.mail_root MAIL_DIR +database.path MAIL_DIR +key with spaces value, with, spaces! +maildir.synchronize_flags true +new.ignore sekrit_junk +new.tags unread;inbox +search.exclude_tags foo;bar;fub +test.key1 testvalue1 +test.key2 testvalue2 +user.name Notmuch Test Suite +user.other_email test_suite_other@notmuchmail.org;test_suite@otherdomain.org +user.primary_email test_suite@notmuchmail.org +zzzafter afterval +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT test_done