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 3FDD56DE0F4B for ; Sun, 7 Apr 2019 13:24:48 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.696 X-Spam-Level: X-Spam-Status: No, score=-2.696 tagged_above=-999 required=5 tests=[AWL=-0.194, 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 wFsFWuFvcMf2 for ; Sun, 7 Apr 2019 13:24:46 -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 E84316DE0EC6 for ; Sun, 7 Apr 2019 13:24:45 -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 EF68D1BD5; Sun, 7 Apr 2019 22:24:42 +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 DkN7561v1hlk; Sun, 7 Apr 2019 22:24:42 +0200 (CEST) X-KTH-Auth: ekeberg [85.229.204.229] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default; t=1554668682; bh=PvD2uY6tSTM/KTsqrufPw4zy09SKPhVWtvDjj8x5mJs=; h=From:To:Subject:In-Reply-To:References:Date; b=e4ZzJUP/BD35f11xYSIIyO0uHBweDS2SNdD1EMkGxiJTZrFCC5f3Lbu6hJitLf7JX qlaZcZU4Y26hzaTZ5fli9QLna172JpfujhETPyC4hjhifaIiAFoLihDFKkXzPOIx5j NIeC4Ounh6RJ3EFh10/fRXrUqSAdT7hzntJakbAs= X-KTH-mail-from: ekeberg@kth.se Received: from swing (c-e5cce555.09-723-73746f39.bbcust.telenor.se [85.229.204.229]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id A015D1E3; Sun, 7 Apr 2019 22:24:40 +0200 (CEST) From: =?utf-8?Q?=C3=96rjan?= Ekeberg To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH v2 4/4] test: add test for checking forwarded messages In-Reply-To: References: <20190404230126.4283-1-ekeberg@kth.se> <20190404230126.4283-5-ekeberg@kth.se> Date: Sun, 07 Apr 2019 22:24:40 +0200 Message-ID: <871s2d5zsn.fsf@swing.csc.kth.se> 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 20:24:48 -0000 Tomi Ollila writes: > On Fri, Apr 05 2019, =C3=96rjan Ekeberg wrote: > >> +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). Short walkthrough: - create a small message in the database (add_message) - set message-hidden-headers to nil so that we can verify them - set notmuch-fcc-dirs to nil to avoid including the fcc-header - get the message we just created (notmuch-show) - create a forwarding message (forwarding the current one) - compare the headers to the expected output - run the send hooks to emulate sending The double run-hooks lines is an error; only the second one is needed. > anyway, it looks like tabs and 8-spaces are used for indenting. Yes. This seems to be common in the emacs code for notmuch, so I did not untabify. > 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) The test was only supposed to check that the forwarded tag was properly added when forwarding. If other tags are added elsewhere in future code, this is not really an error and should not be flagged by the test, should it? > Tomi Thanks for your feedback. /=C3=96rjan