From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qPmNBygcml46KgAA0tVLHw (envelope-from ) for ; Fri, 17 Apr 2020 21:14:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oEEtBSwcml6gEwAAB5/wlQ (envelope-from ) for ; Fri, 17 Apr 2020 21:14:20 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D91E3940AF7 for ; Fri, 17 Apr 2020 21:14:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 00E5F6DE138F; Fri, 17 Apr 2020 14:14:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 1_-BJ41xEQYW; Fri, 17 Apr 2020 14:14:14 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id F109A6DE1394; Fri, 17 Apr 2020 14:14:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6FB5A6DE1394 for ; Fri, 17 Apr 2020 14:14:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 M2YAHmgXeeZN for ; Fri, 17 Apr 2020 14:14:09 -0700 (PDT) Received: from olitb.net (olitb.net [37.187.104.224]) by arlo.cworth.org (Postfix) with ESMTP id 31FC06DE138F for ; Fri, 17 Apr 2020 14:14:09 -0700 (PDT) Received: from localhost (unknown [IPv6:2a00:5881:4008:6c00:356:87c5:20e7:7d90]) by olitb.net (Postfix) with ESMTPSA id 493A0DF554 for ; Fri, 17 Apr 2020 23:15:13 +0200 (CEST) Date: Fri, 17 Apr 2020 23:13:56 +0200 From: Olivier =?utf-8?B?VGHDr2Jp?= To: notmuch@notmuchmail.org Subject: [PATCH] test: sort the output of the "prefix" test in T610-message-property as needed Message-ID: <20200417211356.ck624lun4nmz6ogd@siegel.lan> MIME-Version: 1.0 Content-Disposition: inline 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-1.21 / 13.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.45818314502286]; URIBL_BLOCKED(0.00)[notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:c]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.01), ip: 50.126.95.6(-0.46)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; TO_DN_NONE(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.50)[cached: notmuchmail.org]; RCVD_IN_DNSWL_MED(-0.20)[50.126.95.6:from]; DMARC_NA(0.00)[olitb.net]; MAILLIST(-0.20)[mailman]; FORGED_SENDER_MAILLIST(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; FROM_NEQ_ENVFROM(0.00)[oli@olitb.net,notmuch-bounces@notmuchmail.org]; RCVD_COUNT_SEVEN(0.00)[8] X-TUID: fPAGqzCHQvI9 the "prefix" test in T610-message-property extracts values from a (key,value) map where multiple entries can have the same key, and the entries are sorted by key, but not by value. The test incorrectly assumes that the values will be sorted as well, so correct this by splitting the output using head and tail and sorting each chunk using sort. NB: the relevant key/values are as follows. testkey1: alice, testvalue1, testvalue2, bob testkey3: alice3, bob3, testvalue3 --- test/T610-message-property.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh index 53a0be3b..e1be2fc3 100755 --- a/test/T610-message-property.sh +++ b/test/T610-message-property.sh @@ -186,6 +186,11 @@ EXPECT0(notmuch_message_add_property (message, "testkey3", "testvalue3")); EXPECT0(notmuch_message_add_property (message, "testkey3", "alice3")); print_properties (message, "testkey", FALSE); EOF +mv OUTPUT unsorted_OUTPUT +head -n 5 unsorted_OUTPUT | sort >OUTPUT +tail -n +6 unsorted_OUTPUT | head -n 3 | sort >>OUTPUT +tail -n +9 unsorted_OUTPUT >>OUTPUT +rm unsorted_OUTPUT cat <<'EOF' >EXPECTED == stdout == alice -- 2.26.0