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 267C46DE0F51 for ; Wed, 10 Apr 2019 05:19:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.691 X-Spam-Level: X-Spam-Status: No, score=-2.691 tagged_above=-999 required=5 tests=[AWL=-0.189, 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 Cz6IcKYqE1-b for ; Wed, 10 Apr 2019 05:19:20 -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 8CF576DE1075 for ; Wed, 10 Apr 2019 05:19:20 -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 C99A2CC4 for ; Wed, 10 Apr 2019 14:19:18 +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 BjOQ3fhvO0Zj; Wed, 10 Apr 2019 14:19:18 +0200 (CEST) X-KTH-Auth: ekeberg [2001:6b0:1:1de0:f050:6264:8d98:45d5] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default; t=1554898758; bh=pIiZ8yRxAHIvRngvIKdLV50MPj0gEYIm+fAWFTkVMCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PpNniGPIiKam12HnyTe/8uGDsSHPeOeTUFfJWrJ7YI1UUuXQSZ9UYqV60yQ0KgEa7 t55uOMOBQU8xdOq/cTkFFYjoysPeUt0rXlIxWPUCaYV4d2RISbNO8IwkD8AZo6yZFN lpVQryrVKxnl7XJzod0LZSRk3U7Cpnb+PznNNsh0= X-KTH-mail-from: ekeberg@kth.se Received: from swing.nada.kth.se (unknown [IPv6:2001:6b0:1:1de0:f050:6264:8d98:45d5]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id F052768E2; Wed, 10 Apr 2019 14:19:17 +0200 (CEST) From: =?UTF-8?q?=C3=96rjan=20Ekeberg?= To: notmuch@notmuchmail.org Subject: [PATCH v3 4/4] test: add test for checking forwarded messages Date: Wed, 10 Apr 2019 14:19:08 +0200 Message-Id: <20190410121908.5998-2-ekeberg@kth.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410121908.5998-1-ekeberg@kth.se> References: <20190404230126.4283-1-ekeberg@kth.se> <20190410121908.5998-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: Wed, 10 Apr 2019 12:19:23 -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 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..d1a573fb --- /dev/null +++ b/test/T730-emacs-forwarding.sh @@ -0,0 +1,30 @@ +#!/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 " + (progn + (notmuch-show \"id:$message_id\") + (notmuch-show-forward-message) + (run-hooks 'notmuch-mua-send-hook) + (notmuch-test-expect-equal (message-field-value \"References\") + \"<$message_id>\"))" + +test_begin_subtest "Forwarding adding the forwarded tag" +# Check that the send hook called in the previous subtest did add the forwarded-tag + +test_expect_equal $(notmuch search --output=messages tag:forwarded) id:$message_id + +test_done -- 2.20.1