From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 693D96DE1424 for ; Fri, 12 Apr 2019 05:02:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.697 X-Spam-Level: X-Spam-Status: No, score=-2.697 tagged_above=-999 required=5 tests=[AWL=-0.195, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GaEDMYCt8Lgv for ; Fri, 12 Apr 2019 05:02:02 -0700 (PDT) Received: from smtp-4.sys.kth.se (smtp-4.sys.kth.se [130.237.48.193]) by arlo.cworth.org (Postfix) with ESMTPS id 655236DE1417 for ; Fri, 12 Apr 2019 05:01:54 -0700 (PDT) Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-4.sys.kth.se (Postfix) with ESMTP id 008492BB7 for ; Fri, 12 Apr 2019 14:01:53 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-4.sys.kth.se ([127.0.0.1]) by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mS4ERdMbB5V0; Fri, 12 Apr 2019 14:01:51 +0200 (CEST) X-KTH-Auth: ekeberg [2001:6b0:1:1de0:5018:5c50:6d6d:7a4] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default; t=1555070511; bh=3DhsZyyULp4KWekY3wOih0yfVBV7FZlDFZHRUUvCevM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ChRwy5qIrxcdOhojN+HfPAnTAFXJsv+h2erEevMGtlhNyw0yapD8KpJE2TMYI3G4+ SeePempQm6YFeEzTwTnwrHav0ugSmNcRLr0+vbpDXAs0+zpZpGVGAojUrkW/B2/PBE Xz/+TeBLwjR0Kqo46BuVMdITBMKadXV7GKb+NKhw= X-KTH-mail-from: ekeberg@kth.se Received: from swing.nada.kth.se (unknown [IPv6:2001:6b0:1:1de0:5018:5c50:6d6d:7a4]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id E17C52854; Fri, 12 Apr 2019 14:01:50 +0200 (CEST) From: =?UTF-8?q?=C3=96rjan=20Ekeberg?= To: notmuch@notmuchmail.org Subject: [PATCH v4 4/4] test: add test for checking forwarded messages Date: Fri, 12 Apr 2019 14:01:13 +0200 Message-Id: <20190412120113.8047-5-ekeberg@kth.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190412120113.8047-1-ekeberg@kth.se> References: <20190404230126.4283-1-ekeberg@kth.se> <20190412120113.8047-1-ekeberg@kth.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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, 12 Apr 2019 12:02:07 -0000 Add test of forwarding messages from within emacs. The first test checks that a references header is properly added to the new message. The second test checks that the send-hook of the forwarding message adds a forwarded-tag to the original message. --- test/T730-emacs-forwarding.sh | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 test/T730-emacs-forwarding.sh diff --git a/test/T730-emacs-forwarding.sh b/test/T730-emacs-forwarding.sh new file mode 100755 index 00000000..45e61568 --- /dev/null +++ b/test/T730-emacs-forwarding.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +test_description="emacs forwarding" +. $(dirname "$0")/test-lib.sh || exit 1 + +test_begin_subtest "Forward setting the correct references header" +# Check that, when forwarding a message, the new message has +# a References-header pointing to the original (forwarded) message. + +message_id='OriginalMessage@notmuchmail.org' +add_message \ + [id]="$message_id" \ + '[from]="user@example.com"' \ + '[subject]="This is the original message"' \ + '[body]="Dummy text."' + +test_emacs_expect_t " + (let ((message-send-mail-function (lambda () t))) + (notmuch-show \"id:$message_id\") + (notmuch-show-forward-message) + (save-restriction + (message-narrow-to-headers) + (message-remove-header \"Fcc\") + (message-remove-header \"To\") + (message-add-header \"To: nobody@example.com\")) + + (notmuch-mua-send) + (notmuch-test-expect-equal + (message-field-value \"References\") \"<$message_id>\")) +" + +test_begin_subtest "Forwarding adding the forwarded tag" +# Check that sending the forwarding message in the previous +# subtest did add the forwarded-tag to the message that was forwarded. + +test_expect_equal "$(notmuch search --output=tags id:$message_id | sort)" \ +"forwarded +inbox +unread" + +test_done -- 2.20.1