From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oH/+GL1632AHVwAAgWs5BA (envelope-from ) for ; Fri, 02 Jul 2021 22:44:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GK6OFL1632ATJAAAbx9fmQ (envelope-from ) for ; Fri, 02 Jul 2021 20:44:45 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 00624AA71 for ; Fri, 2 Jul 2021 22:44:45 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 05E6427D92; Fri, 2 Jul 2021 16:44:34 -0400 (EDT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 94F6B26C01 for ; Fri, 2 Jul 2021 16:44:30 -0400 (EDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:44314) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzQ1W-000867-3a; Fri, 02 Jul 2021 16:44:30 -0400 Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:47788 helo=osgiliath.local) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzQ1V-0001Wt-RU; Fri, 02 Jul 2021 16:44:30 -0400 From: jao To: notmuch@notmuchmail.org Subject: [PATCH v3 2/5] CLI/show: tests for the new --sort option Date: Fri, 2 Jul 2021 21:44:21 +0100 Message-Id: <20210702204424.2018666-3-jao@gnu.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702204424.2018666-1-jao@gnu.org> References: <20210702204424.2018666-1-jao@gnu.org> MIME-Version: 1.0 Message-ID-Hash: UGVRGKW2SPUOGDKXTJSORKCJGSXVQAKJ X-Message-ID-Hash: UGVRGKW2SPUOGDKXTJSORKCJGSXVQAKJ X-MailFrom: jao@gnu.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: jao X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625258685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fGUv8yjQLkvalyJBhbgEsk3ivbHTovlZfzTjFzc5E1o=; b=jHJR6TQMbTAxbkVyE6IC9mpLYdJ+O7uSiy7N2JV86rH4V4K9cALrXmBFX/lpCH7a0UkPqJ 7Pi+9j8oAvXMjQke+eQt0+gAs2yg0pV8LENR0F9fNk59ZWLgBXWF9No/ULh8ohBBlKpmoi 43xTyerGW1afb7QH7L9wltMBG4uZZwyuhIoBzC2gPXmN3ZPP3Tj4ozbRG52g3sw2AFCFSJ sUnkbeK7mbqtXQ9Vu9Vj2ndSeaiZfA/63FlIArHDczl8V+imdFWRd0+hnu02iOyL1SkvcK rdDNwlvBXGI3vf1r7klxAT/weEcP1CZvm6GC9Qrdp92oLt7/P8AHlX5uq4MzyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625258685; a=rsa-sha256; cv=none; b=Czk5VPBL+qO4IL4uMmVQ3m6tbVDI2/0GMIzRiYPFkVvaoRN5UeXDmVVGzO0y9OnHzaAYXx Cpy8Pzohq32Gel0WVPxDxW6jZNDqczFjm8If/P+FRF5Z/ylQRr0SwEsc8c6fFMLmaj92dj QJMpmNl23sGGrE7rgDOGWHKYUkkRhH5rjF/fgH9+OILxGRrjIizIspzC9WZI1QFqld0vek X3mY95RnD59dTql4ft+eQ/BemujX5rod2QlRm4d5pulJIqydYTYa9wVnRM80qAaxqQ+A3h LGVIbvGkLQ2VDoWMeAHCZ01ti+xm+vZllOgiyc/TGIFZVVzHHN5qUSb4UrItqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.95 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 00624AA71 X-Spam-Score: -0.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: J5pCURqU4gBc New unit tests for notmuch show --sort, covering the basic use cases. --- test/T520-show.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/T520-show.sh b/test/T520-show.sh index 16222650..6f42ca12 100755 --- a/test/T520-show.sh +++ b/test/T520-show.sh @@ -10,4 +10,21 @@ notmuch show foo.. exit_code=$? test_expect_equal 1 $exit_code +test_begin_subtest "notmuch show --sort=newest-first" +notmuch show --entire-thread=true '*' > EXPECTED +notmuch show --entire-thread=true --sort=newest-first '*' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch show --sort=oldest-first" +notmuch show --entire-thread=true '*' | grep ^depth:0 > EXPECTED +notmuch show --entire-thread=true --sort=oldest-first '*' | grep ^depth:0 > OLDEST +perl -e 'print reverse<>' OLDEST > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "notmuch show --sort for single thread" +QUERY="id:yun1vjwegii.fsf@aiko.keithp.com" +notmuch show --entire-thread=true --sort=newest-first $QUERY > EXPECTED +notmuch show --entire-thread=true --sort=oldest-first $QUERY > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + test_done -- 2.32.0