From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6GB7Hcts12BXdAAAgWs5BA (envelope-from ) for ; Sat, 26 Jun 2021 20:07:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8NQ6Gcts12CUUwAA1q6Kng (envelope-from ) for ; Sat, 26 Jun 2021 18:07:07 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0AF8412943 for ; Sat, 26 Jun 2021 20:07:07 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CABAC290D9; Sat, 26 Jun 2021 14:06:58 -0400 (EDT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 0D63D2904D for ; Sat, 26 Jun 2021 14:06:55 -0400 (EDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:35634) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxChi-0003Md-Ki; Sat, 26 Jun 2021 14:06:54 -0400 Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:46268 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 1lxChi-0000I6-Ca; Sat, 26 Jun 2021 14:06:54 -0400 From: jao To: notmuch@notmuchmail.org Subject: [PATCH 2/5] CLI/show: tests for the new --sort option Date: Sat, 26 Jun 2021 19:06:47 +0100 Message-Id: <20210626180650.342569-3-jao@gnu.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210626180650.342569-1-jao@gnu.org> References: <20210626022846.233052-1-jao@gnu.org> <20210626180650.342569-1-jao@gnu.org> MIME-Version: 1.0 Message-ID-Hash: MPBNIW5FZVUXVTLDKJMD2RN3XXFZCP3U X-Message-ID-Hash: MPBNIW5FZVUXVTLDKJMD2RN3XXFZCP3U 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=1624730827; 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=SmpKCs7WsCz+R0DB3a45WsGIw+z5WU4Th/VP9IAqN1SJoSpSKFTcPVg16eQqFuXI22PKXf 6qMLaSyOYGQ4kze7kp9tGFIBwBGDq0A/a9TWg4VjsDCNKahxK2jcf4Pqkc7WUkTctd5ZcM JeRpv3R2rEQxrXllqUhGJqWjwU24nQaTd8wNOrLW4SasMXtCIiPcqelGsfoI7XkwEdS3Gy uRl/H6KJwyuqyB5RnEk7uerbpTfF3y35ZRyiVaM8Km0lfPLlqvxGZXTYUqkzV6LSljMhBt E8oFSMfRsva2vkAHM5cQbP1y/vmItbgCv4I7eoMK6ZS0f3z8uow16Xo6B5DDxw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624730827; a=rsa-sha256; cv=none; b=j+0sHZobdMcXVBWMdWBIjnmzNOjxZgtRd4rFbtwdJyjawwGX4bp1QFiSNNauvY1nbBTVnd dzEmjbP3CYH8VJ1olFsskePCZQttbQunJcZ/p6MSQ0YWKeggfq1M0B4ly0hot4D6FQ/YiP t7BHMyDBrixDtPlSTQtGrKMcvJuCT9Lx021N1Syt6PiODbRfLC65XdySf9n9Q8MAQtsJeV etzMGSdxApYVuIgtlzTUtmoQ7uYahZU80RdwHVGrzI29XQDGRbMIltYRjFgOgQhC+ej0DA C1KJlcX4pPGzHmnwujuxXOQlgbpAC47sZEcJBHDbvVqZYJE3mqpAELuA2c/IEQ== 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.91 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 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 0AF8412943 X-Spam-Score: -0.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: w5HqbG2BYanp 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