X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT050-new.sh;h=5c07b2096107266d3be04790fd465a7aac3d20b8;hb=ef0b1266190141b108a338ba06348e335ec4957b;hp=882939fabc4264e73b946713d20a37eb9a743b65;hpb=4c79a2dabe38ac72eb9eb21620f2ffca5f1885c6;p=notmuch diff --git a/test/T050-new.sh b/test/T050-new.sh index 882939fa..5c07b209 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -339,11 +339,25 @@ test_expect_code 1 "NOTMUCH_NEW --debug 2>&1" notmuch config set new.tags $OLDCONFIG +test_begin_subtest "Long directory names don't cause rescan" +test_subtest_known_broken +printf -v name 'z%.0s' {1..234} +generate_message [dir]=$name +NOTMUCH_NEW > OUTPUT +notmuch new >> OUTPUT +rm -r ${MAIL_DIR}/${name} +notmuch new >> OUTPUT +cat < EXPECTED +Added 1 new message to the database. +No new mail. +No new mail. Removed 1 message. +EOF +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "Xapian exception: read only files" -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.* +chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.* output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' ) -chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.* +chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.* test_expect_equal "$output" "A Xapian exception occurred opening database" @@ -380,13 +394,26 @@ exit status: 75 EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Relative database path expanded in new" +test_subtest_known_broken +ln -s "$PWD/mail" home/Maildir +notmuch config set database.path Maildir +generate_message +NOTMUCH_NEW > OUTPUT +cat <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 + 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" test_begin_subtest "reference loop ordered by date" -threadid=$(notmuch search --output=threads id:mid-loop-12@example.org) -notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT +threadid=$(notmuch search --output=threads id:mid-loop-12@example.org) +notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT cat < EXPECTED Date: Thu, 16 Jun 2016 22:14:41 -0400 Date: Fri, 17 Jun 2016 22:14:41 -0400