From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eB6oLxOR1mAoiwAAgWs5BA (envelope-from ) for ; Sat, 26 Jun 2021 04:29:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wAVaKxOR1mDEUQAA1q6Kng (envelope-from ) for ; Sat, 26 Jun 2021 02:29:39 +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) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3E8361326B for ; Sat, 26 Jun 2021 04:29:39 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 2DB3F290CA; Fri, 25 Jun 2021 22:29:20 -0400 (EDT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 852EA27D90 for ; Fri, 25 Jun 2021 22:29:05 -0400 (EDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:43854) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwy49-0000Aq-6u; Fri, 25 Jun 2021 22:29:05 -0400 Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:37900 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 1lwy48-0003CZ-TR; Fri, 25 Jun 2021 22:29:05 -0400 From: jao To: notmuch@notmuchmail.org Subject: [PATCH 5/7] CLI/show: tests for the new --sort option Date: Sat, 26 Jun 2021 03:28:44 +0100 Message-Id: <20210626022846.233052-6-jao@gnu.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210626022846.233052-1-jao@gnu.org> References: <20210626022846.233052-1-jao@gnu.org> MIME-Version: 1.0 Message-ID-Hash: RNZN4NKS3EB5MTWZ34DKW7YDHYNNAYQ2 X-Message-ID-Hash: RNZN4NKS3EB5MTWZ34DKW7YDHYNNAYQ2 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=1624674579; 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=nNdwExOvPyANG0r8srSewPmIg0RJH36NYrFl+DRyiu0FZWpbgTFYV94gyZPvFlsTnSE+CK l6NtNc5/2fPCNC/lfyQUUYImvYQOZYdiNO9rmjuBESsAsSLmbsb6WLyTbATwSyHscN1XJ5 t85ss1yTWa+HcWo/KKelAeR7GBv0/Xzfo4lhtHaa+vPTo7oIpmZKMispZ5pjgg07prYzC3 vVD1kNQZTT0KTsubFPCuWg+tG9tDLn6RZ/z+fslzWYkTErrBYWdV1gS4EWLqzDb1YSvvry KFQnnImrDjcm3GHJKdzw1m0lP8n9fu66x7nRNYX4L9a/pqB2gnSXeQyQfkAk7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624674579; a=rsa-sha256; cv=none; b=cewb2k/mDTu/rLkwmE300VtyH2bGI11YhSwo4DzyGP1NlIevGEqjKLISZhMtOZVDsNzKAz i/NPA6KvMEou0WEvNR18kr030+u54DYtgm1F7uCURqil96QRurale3feMvtsPuJcE1cJRu jUrzt1wQCkDH4BLegFl24ZfL6nR33nEUhkWW+uYkbQl+A/BWRE2Z8i5vdAD3/gFGoqsyOT YwS7KZXPAD+zmCsWFsJyYJYzwc3M9rRoUQMrGMWsdO3Ez0TwPbxuufDm3t/9opp+bqGavQ v645Y5ZwKI+6x8ZGVegsOlP2Fe0Vi5zGpXyByJapxhMzDK10RhKZ2z9gHT+yUw== 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.90 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: 3E8361326B X-Spam-Score: -0.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: jmF1/czKbSMI 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