diff options
| author | Daniel Schoepe <daniel@schoepe.org> | 2015-08-11 10:02:16 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-11-19 07:51:14 -0400 |
| commit | 40325352db282e829ce39a2a07117c713b924f0d (patch) | |
| tree | 5edc6bfa09f4f2308988e0a150bc460cb55adfcd /test/T150-tagging.sh | |
| parent | 8b5644e63d49a8841d32130d67c465da0623db74 (diff) | |
test: Tests for combining --batch and --remove-all
This patch adds some tests for combining --remove-all with --batch or
--input when calling notmuch-tag.
Diffstat (limited to 'test/T150-tagging.sh')
| -rwxr-xr-x | test/T150-tagging.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh index 821d3933..8adcabce 100755 --- a/test/T150-tagging.sh +++ b/test/T150-tagging.sh @@ -38,6 +38,17 @@ test_expect_equal "$output" "\ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One () thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (tag5 tag6 unread)" +test_begin_subtest "Remove all with batch" +notmuch tag +tag1 One +notmuch tag --remove-all --batch <<EOF +-- One ++tag3 +tag4 +inbox -- Two +EOF +output=$(notmuch search \* | notmuch_search_sanitize) +test_expect_equal "$output" "\ +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One () +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag3 tag4)" + test_begin_subtest "Remove all with a no-op" notmuch tag +inbox +tag1 +unread One notmuch tag --remove-all +foo +inbox +tag1 -foo +unread Two @@ -102,6 +113,20 @@ notmuch search \* | notmuch_search_sanitize > OUTPUT notmuch restore --format=batch-tag < backup.tags test_expect_equal_file batch.expected OUTPUT +test_begin_subtest "--batch --input --remove-all" +notmuch dump --format=batch-tag > backup.tags +notmuch tag +foo +bar -- One +notmuch tag +tag7 -- Two +notmuch tag --batch --input=batch.in --remove-all +notmuch search \* | notmuch_search_sanitize > OUTPUT +notmuch restore --format=batch-tag < backup.tags +cat > batch_removeall.expected <<EOF +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; One (@ tag6) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (tag6) +EOF +test_expect_equal_file batch_removeall.expected OUTPUT +rm batch_removeall.expected + test_begin_subtest "--batch, blank lines and comments" notmuch dump | sort > EXPECTED notmuch tag --batch <<EOF |
