X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftagging;h=1f5632cb3da838dbcae52658301c53efc097bd2f;hb=e43e0af920ead3beb17a4a9c821042cfe56a7ab7;hp=417112b8dd4fabe9e7c95b20229bce2b3b63092a;hpb=9a31cbd3867b286fb7c26533d1d8589d49e879cc;p=notmuch diff --git a/test/tagging b/test/tagging index 417112b8..1f5632cb 100755 --- a/test/tagging +++ b/test/tagging @@ -198,6 +198,49 @@ notmuch dump --format=batch-tag | sort > OUTPUT notmuch restore --format=batch-tag < BACKUP test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "--batch: only space and % needs to be encoded." +notmuch dump --format=batch-tag > BACKUP + +notmuch tag --batch < EXPECTED ++%23possible%5c +%26are +%28tags%29 +crazy%7b +inbox +match%2acrazy +space%20in%20tags +tag4 +tag5 +unread +winner -- id:msg-002@notmuch-test-suite ++foo%3a%3abar%25 +found%3a%3ait +inbox +tag5 +unread +winner -- id:msg-001@notmuch-test-suite +EOF + +notmuch dump --format=batch-tag | sort > OUTPUT +notmuch restore --format=batch-tag < BACKUP +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest '--batch: unicode message-ids' + +${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \ + --num-messages=100 + +notmuch dump --format=batch-tag | sed 's/^.* -- /+common_tag -- /' | \ + sort > EXPECTED + +notmuch dump --format=batch-tag | sed 's/^.* -- / -- /' | \ + notmuch restore --format=batch-tag + +notmuch tag --batch < EXPECTED + +notmuch dump --format=batch-tag| \ + sort > OUTPUT + +test_expect_equal_file EXPECTED OUTPUT + test_expect_code 1 "Empty tag names" 'notmuch tag + One' test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'