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 087E86DE0F6A for ; Sun, 7 Apr 2019 12:39:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.45 X-Spam-Level: X-Spam-Status: No, score=0.45 tagged_above=-999 required=5 tests=[AWL=-0.202, SPF_NEUTRAL=0.652] 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 yAD0lS5gPF91 for ; Sun, 7 Apr 2019 12:39:17 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 5B9166DE0F51 for ; Sun, 7 Apr 2019 12:39:16 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id EEA0C1000D0; Sun, 7 Apr 2019 22:39:10 +0300 (EEST) From: Tomi Ollila To: =?utf-8?Q?=C3=96rjan?= Ekeberg , notmuch@notmuchmail.org Subject: Re: [PATCH v2 4/4] test: add test for checking forwarded messages In-Reply-To: <20190404230126.4283-5-ekeberg@kth.se> References: <20190404230126.4283-1-ekeberg@kth.se> <20190404230126.4283-5-ekeberg@kth.se> User-Agent: Notmuch/0.28.3+42~g7b16377 (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Sun, 07 Apr 2019 19:39:19 -0000 On Fri, Apr 05 2019, =C3=96rjan Ekeberg wrote: > 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 | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 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..0bdd197f > --- /dev/null > +++ b/test/T730-emacs-forwarding.sh > @@ -0,0 +1,35 @@ > +#!/usr/bin/env bash > + > +test_description=3D"emacs forwarding" > +. $(dirname "$0")/test-lib.sh || exit 1 > + > +test_begin_subtest "Forward setting the correct references header" > +message_id=3D'OriginalMessage@notmuchmail.org' > +add_message \ > + [id]=3D"$message_id" \ > + '[from]=3D"user@example.com"' \ > + '[subject]=3D"This is the original message"' \ > + '[body]=3D"-----Original Message----- > +Text here."' > + > +test_emacs "(let ((message-hidden-headers ()) > + (notmuch-fcc-dirs ())) > + (notmuch-show \"id:$message_id\") > + (notmuch-show-forward-message) > + (run-hooks 'notmuch-mua-send-hook) > + (message-narrow-to-headers) > + (test-visible-output)) > + (run-hooks 'notmuch-mua-send-hook)" Cannot fully understand the above (or, actually not much of it), perhaps someone else(tm). anyway, it looks like tabs and 8-spaces are used for indenting. then, instead of only checking forwarded tag was added, checking checking all tags should be done, so that there is nothing extra (that check twice, first after add_message, and then at the end) Tomi > + > +cat <EXPECTED > +From: Notmuch Test Suite > +To:=20 > +Subject: [user@example.com] This is the original message > +References: <$message_id> > +EOF > +test_expect_equal_file EXPECTED OUTPUT > + > +test_begin_subtest "Forwarding adding the forwarded tag" > +test_expect_equal $(notmuch search --output=3Dmessages tag:forwarded) id= :$message_id > + > +test_done > --=20 > 2.20.1