From: Pieter Praet Date: Fri, 24 Feb 2012 22:30:36 +0000 (+0100) Subject: [PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7ec02db3a80c4b7153e6764c115c92120448414a;p=notmuch-archives.git [PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer" --- diff --git a/03/1c429b10b9341c0aecf9c060fe90bdebd1b678 b/03/1c429b10b9341c0aecf9c060fe90bdebd1b678 new file mode 100644 index 000000000..f18ab6c22 --- /dev/null +++ b/03/1c429b10b9341c0aecf9c060fe90bdebd1b678 @@ -0,0 +1,104 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4FA5D415D3A + for ; Fri, 24 Feb 2012 14:33:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id u8tGziCc3Bws for ; + Fri, 24 Feb 2012 14:33:30 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 837E241601D + for ; Fri, 24 Feb 2012 14:33:27 -0800 (PST) +Received: by werp13 with SMTP id p13so2016564wer.26 + for ; Fri, 24 Feb 2012 14:33:26 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.180.79.229 as permitted sender) client-ip=10.180.79.229; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.180.79.229 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.180.79.229]) + by 10.180.79.229 with SMTP id m5mr8940894wix.6.1330122806363 (num_hops + = 1); Fri, 24 Feb 2012 14:33:26 -0800 (PST) +MIME-Version: 1.0 +Received: by 10.180.79.229 with SMTP id m5mr7218606wix.6.1330122806306; + Fri, 24 Feb 2012 14:33:26 -0800 (PST) +Received: from localhost ([109.131.181.26]) + by mx.google.com with ESMTPS id h19sm6281024wiw.9.2012.02.24.14.33.25 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 24 Feb 2012 14:33:25 -0800 (PST) +From: Pieter Praet +To: David Bremner , + Dmitry Kurochkin +Subject: [PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of + all messages in current buffer" +Date: Fri, 24 Feb 2012 23:30:36 +0100 +Message-Id: <1330122640-18895-3-git-send-email-pieter@praet.org> +X-Mailer: git-send-email 1.7.8.1 +In-Reply-To: <1330122640-18895-1-git-send-email-pieter@praet.org> +References: <87wr7xqpuf.fsf@rocinante.cs.unb.ca> + <1330122640-18895-1-git-send-email-pieter@praet.org> +X-Gm-Message-State: + ALoCoQkaxTo3ZEmixKERR+iUvCGJgmV/I9w68n7QmNd8kGtGCHf0+e54NnFc2Q1L2QKm0F/KsrJ7 +Cc: Notmuch Mail +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 24 Feb 2012 22:33:31 -0000 + +* test/emacs: + + New subtest "notmuch-show: change tags of all messages in current buffer": + `notmuch-show-tag-all' ("*") changes tags of *all* messages in current buffer. +--- + test/emacs | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +diff --git a/test/emacs b/test/emacs +index ec1dbb0..d2dbafc 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") + output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" + ++test_begin_subtest "notmuch-show: change tags of all messages in current buffer" ++query="$os_x_darwin_thread" ++filter="from:Jiang" ++add_tag="notmuch-show-tag-all" ++del_tag="inbox" ++count_total=$(notmuch count -- "$query") # = 4 ++count_match=$(notmuch count -- "$query" AND "$filter") # = 2 ++test_emacs "(notmuch-search \"$query AND $filter\") ++ (notmuch-test-wait) ++ (notmuch-search-show-thread) ++ (execute-kbd-macro \"*+$add_tag -$del_tag\")" ++count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag") ++notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes ++test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL ++ + test_begin_subtest "Message with .. in Message-Id:" + add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' + test_emacs '(notmuch-search "id:\"123..456@example\"") +-- +1.7.8.1 +