From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IBwrFpW6bWYqVgAAqHPOHw:P1 (envelope-from ) for ; Sat, 15 Jun 2024 16:00:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IBwrFpW6bWYqVgAAqHPOHw (envelope-from ) for ; Sat, 15 Jun 2024 18:00:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=B1mfWXFg; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718467221; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=IQc5f9rb1FGteAE9eekEr0GlkOD1fM3eu/O+Z3IQyak=; b=oYh8JphB1JWY9ip9MyTdaQVjixdc2UcLIAXQBE/mv7Pb3sUZzjxyYq435w1ysNT4EouSbH eSVitSanptIP4HykAbf1Xy4BGXqxYaZm7lFjYD0/8xSv4CIxecMnXFC0/2zaPMb/rfam6O loWPNPF6s9xFm+541QAyI0uJpnbN7FSHEaISvlXq2E1h76p0anTgtyERwiO/L1HHYFE0Mk S1vfGKDMErK34g3tml072Vk4kNT0vLzNWkyUqrUPFF6+lqPD3JGAggg6jwP9pyJNhKH644 XZpiTupKmhN/kWGlP9XBFtyeNn6MuRi9CzXM/UOvgVuCMw6jF9zJyGvO4PkoOg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=B1mfWXFg; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1718467221; a=rsa-sha256; cv=pass; b=qpFRHMVjoYQfttfI4GhbQogkGvmux9G1Mhy8Gjq5WYCk3iSOPsMeLvYN4YSj7hQ2397J3l aAHiBZkvtkiRYIMWomZNXTSftZMqRdC8tMLGYKY2zHBM9PXWIXwQiQMDz1P14T2nw5EaPA 0UkHS/SgO3JkFfh2WW5oRd/EliqCL5LFHzci4Z57MaHM1A+EkbUQ6IqKjBBzj6VCz0fclA PJFj83Qe4mLu5LV375WVJR8p8Bs5ZhgLerwcytlv7sf+gxdk8RnlGKJ62bzipnvjVz7Mqt i4izTBEIvE5eKzcG0NneYblcUy2vghiO7Uwu/DqrLquIicgmBUYU8+khOMNB1Q== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2A67E11092 for ; Sat, 15 Jun 2024 18:00:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIVQj-000877-Dc; Sat, 15 Jun 2024 11:35:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIVQi-00086q-2V for emacs-orgmode@gnu.org; Sat, 15 Jun 2024 11:35:00 -0400 Received: from mail-dm6nam12olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2c17::800] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIVQf-0004Jm-P4 for emacs-orgmode@gnu.org; Sat, 15 Jun 2024 11:34:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G4GhT0GSXRBQnd2Grmlw36eU81RLl+hFe1c+QQ2so9aOiVOQHKaH0CYMfqI9EtVbfsHI66+9S1uziWgxlS+6O+VzfjzyyPkSrHbZTk8cYg9zEmnXpKNv0lxM9RauKqgWPFGpiqdLQYG4T3HOFTUDOUKE66rl6naSp41AHykobvAMEQZjGaUI4BxOKs8RAcJ3BmKzljIVlY+AVgxloC/vh3kIdnzUM4PQzFmP2dPF1ypHYLDLCORxikltWShooBFYk9jrJ1XXnn18xLzoX8k2o0Oj8dK6l1Wf7rppfHiXAgu1g8Kc6dmRp3mGeWXtTET7kziWuYtPXqXUt8HxH8fPng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IQc5f9rb1FGteAE9eekEr0GlkOD1fM3eu/O+Z3IQyak=; b=TGkKnm124d+72yqppzy2Nojhe4g1p3JEl4vC9n3+f50eXa9g0p8H0FZnJAQyfAS2sPIkVzsAoFil89TxtXu/vRGU9vl+B3ebcqxkSN59dwqbS6T9OIcOf0dEcDtgeyALZWcwMhPNfGnxr/sE47qhS5OgdymNonveCFPYjxILds3Lir6U0ufw0VgFF4Vmt/iM1rp20mFez46y8oweeBFmWWwWhez7GG/cJV7msMsBr/5Uo/ng8YFZNzYy4qDTAWjtREN/K4h469MEETceCAAo3HQeiV8IWHGQbBTiL9NacEWZfqEXRgzHZTzqObn6yIkqLcBhWHYuLaa5LnVEjCd9uA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IQc5f9rb1FGteAE9eekEr0GlkOD1fM3eu/O+Z3IQyak=; b=B1mfWXFg9cgb3LSYnaOjlinV7lUYoy8xhA0vM82lySMGHffBhg2M91klTGhX6WYtcuB1xt5YYz+GeCaEs1jAjTFVSBd6zy1Er0TeOWSoGIfLNSmK9/ZZQPF/LfWjLy4YgA3JHcYCNTZIbbImlL1/Bo/lbmypmarrEgCROynEPSl/y/qEBfFHd6rnR1xttVWCFKCjJhz8Q6pBMqyK/xY69Ck4HfhULjMDI+SV/UlehYH7ijMjslamdma6u48OgmmMr6M5sYZZzV6lVo61mvpCZBFMp7gZ9j+AwXdRbw2oHj1JJ1SGEiDCJlWqqBC+QFogNyzqrzNnz0cIhwBw8j4tow== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by MW4PR84MB1490.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1a5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.28; Sat, 15 Jun 2024 15:34:54 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%3]) with mapi id 15.20.7677.027; Sat, 15 Jun 2024 15:34:48 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Cc: Morgan Smith Subject: [PATCH] Testing: Add tests for `org-tags-sort-function' Date: Sat, 15 Jun 2024 11:27:59 -0400 Message-ID: X-Mailer: git-send-email 2.45.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [D3JpxB7Mwm3KXXlycWhYLT8VORdHE92a] X-ClientProxiedBy: YQBPR0101CA0036.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00::49) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20240615152758.4291-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|MW4PR84MB1490:EE_ X-MS-Office365-Filtering-Correlation-Id: e2206c2d-4084-4724-904f-08dc8d50b06a X-Microsoft-Antispam: BCL:0; ARA:14566002|461199025|440099025|3412199022|1710799023; X-Microsoft-Antispam-Message-Info: D/rOkkknHE0bnCPxEsNEFeZacjgnz7UbDyFJD4dW87syu9rNtepWeRyP5d+y/duZW4+KSwZh9MCjyTmLYP6lXzC96RrnOCSBy2zDEMdMqhOR8RZUOxRIF+LYzht1wmacHz6jEK1BkF8hZX7PD4zyer461/5BQGsdiLJSuTZeIXSL5ihFcacjAauLh4p1aDdvudgeJUg7XoRI+BVPdl97Kk0pcRGk5+MY1pIt5JxodegnphuhMr2mGcc+NpPAkVaIdEFGbD3s5FgMMyPM3R/AacJgPTnA3C3hb5TMYmrC3kKdLUKsCZXKlj0OmVgDV1PIZEiRrH0QI2UzowcYPsj0VEFsblXo+XkGGb7V589vMZ5sPPpvfgT0mnHDAFm1vb4o0yH0H6knyoy1eSxKcT+HVgmfFOI6gVAN0sCcGQytbHJw4OUkGpFe1aDeDWTx/KWvbznSMFrrSFXobfi+/dK3CY+GqolntSFrysDLdbK2nfK30WE16RbTI3brzes89mPK9doTqJYP8GpFaumq8Ele44/KxznL2FLlK/fD4eEbWZ/qmpSAcqokh7VJe2jo+fqpyOFN4Uf1tWK2r1CDw/pD0UmYRVg3iBmS2+sMxHpIYnrkftai1ZHpzsSk0xPgijGf X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7N7+8INJLwaS9KW8wLu1BFpnUZQ+nxtBreVuon7XMx/hxGbwF5tGQuG75K+E?= =?us-ascii?Q?Ts6VTtoEcKHtPPb5tjo4oaBjt5gyyEcGI+jj36SjU4GD3Ky2KQ4VypCzFgkX?= =?us-ascii?Q?BKS/X+BVRXe+ksDRV+3ba8ZsnCUNJLpdZ9l8K0grHwAvYMaBZ0WhtBguC2Ep?= =?us-ascii?Q?20+DA9vDtj003xcqnC/ZwbW97quCVhOItuvRm7dOs3EuLQRyclJTsLxWa/qj?= =?us-ascii?Q?49cnM3et6todpPa/2+x5E11EesBXU9wDSSJZaMxU4pAeSnVMoy1+9qBlYZQ6?= =?us-ascii?Q?u9Pts8r5rcfgbkCwcXghcr5b09QlNzE/amQGz1ZLlpOlwMeXK/mNbLRgHic7?= =?us-ascii?Q?7z+UN2whbd7zwGpZ6rofHorRM1b6jWXnW5JIkEEft7OXiGmIi2jnrWvdyZ5u?= =?us-ascii?Q?RIy/SYBY1hLCG4hEITN+x8XPO6bpJMZIn4IbrFHMQLQSe6bKhEutwvdTy0L7?= =?us-ascii?Q?CvSXwuYnbNe+CWnGbU7pofOTyQL1UURcnDhdh+O1d3pfsMRs4prmoMsXGAQv?= =?us-ascii?Q?gHczpPG8BhuyZHewbMpmD/MiKMbY07OQSmQj7vH5kAUUGbInxJsiSkamGgRA?= =?us-ascii?Q?pDsIlX0MixmZQmrEmJAKePt1jmGAuavnxQN7f2lwiEm2n8/bT9uqEdxj1hEn?= =?us-ascii?Q?CIsrJaKIwOX61/+SCHJ3qX2GJxPerfYAVne583owEzfCorii7ozGVneuVwP0?= =?us-ascii?Q?VG7kiRrAy+6tMryY21SIQLX5WZBzu5bmMEarSKOY+j0FgjgtGI9O8XpBN4sj?= =?us-ascii?Q?hOyvlVGn2KQ7HR5mW3eqXcjw6nHYANRXj1M9SH1rB37b/uYUyLN9vsf+EoF0?= =?us-ascii?Q?nKOSz/3tMOm/CjbmOEtkZouUHDOe2LF2Xxgs4nTmmq11qiNy/4ipWy7+WlKk?= =?us-ascii?Q?g/tV1aGNqUjJbh5Mvw165cCU+TmejGhl8Zl5jIkyDjSEhBamYYveeJofqFce?= =?us-ascii?Q?MiVpiF9Zrga7/iuwpEqbsoQkUqMvexYfAZ6Kxg0NCIBONYdE9/o08uT6ymwK?= =?us-ascii?Q?yOae5rffkD1+Ucpyga6K9QAxLxxWesDCVcPgffjDGuyDJISR0+wMH949ceNU?= =?us-ascii?Q?GUAmrym7v3E61ekFGUl0kqo0FZU3LE2bpZvYAIp8rVgFxMks4oOQ8gvArdfU?= =?us-ascii?Q?iW4xoOnfLqeB4YR2957LnDOyAR+khNI/BPQCxVcAPNy4hS2S+z2aiPhVOK13?= =?us-ascii?Q?Z89uD5IPCtPqSyIC7FB0Q+0YORFaubF+0gvmXg1t83WJ2rA3FFDjTQCT9eiS?= =?us-ascii?Q?5CVw3EkqiyjxUtF/1Adx?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2206c2d-4084-4724-904f-08dc8d50b06a X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2024 15:34:47.8166 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR84MB1490 Received-SPF: pass client-ip=2a01:111:f403:2c17::800; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 2A67E11092 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -9.47 X-Spam-Score: -9.47 X-TUID: kDLVFygY1FXB * testing/lisp/test-org-agenda.el (test-org-agenda/tags-sorting): New test. --- Hello! I just recently sent in a patch to add a new possible value for `org-tags-sort-function'. To ease discussion there, I thought I'd add a nice little test here so I can later show off the feature I'm trying to add. Do notice that TODO I put in the comment though. Not sure what the solution to that should be. It would be nice to accept this patch even with the TODO so I can make patches in the other discussion that extend this test. Or I suppose I could try being patient. That doesn't sound as fun though. Thanks, Morgan testing/lisp/test-org-agenda.el | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el index 778f91e8e..c1092df3b 100644 --- a/testing/lisp/test-org-agenda.el +++ b/testing/lisp/test-org-agenda.el @@ -655,6 +655,55 @@ Sunday 7 January 2024 (buffer-string)))))) (org-test-agenda--kill-all-agendas)))) +(ert-deftest test-org-agenda/tags-sorting () + "Test if `org-agenda' sorts tags according to `org-tags-sort-function'." + (let ((org-agenda-custom-commands + '(("f" "no fluff" todo "" + ((org-agenda-todo-keyword-format "") + (org-agenda-overriding-header "") + (org-agenda-prefix-format "") + (org-agenda-remove-tags t) + (org-agenda-sorting-strategy '(tag-up)))))) + ;; Sorting doesn't care about `org-tag-alist'. This is only + ;; here for later when we add sorting methods that do + (org-tag-alist + '((:startgrouptag) + ("group_a") + (:grouptags) + ("tag_a_1") + ("tag_a_2") + (:endgrouptag) + (:startgroup) + ("tag_b_1") + ("tag_b_2") + (:endgroup) + ("groupless") + ("lonely")))) + (org-test-agenda-with-agenda + (string-join + '("* TODO group_a :group_a:" + "* TODO tag_a_1 :tag_a_1:" + "* TODO tag_a_2 :tag_a_2:" + "* TODO tag_b_1 :tag_b_1:" + "* TODO tag_b_2 :tag_b_2:" + "* TODO groupless :groupless:" + "* TODO lonely :lonely:") + "\n") + (dolist (org-tags-sort-function '(nil org-string< org-string>)) + (should + (string-equal + (progn + (org-agenda nil "f") + (substring-no-properties (buffer-string))) + (pcase org-tags-sort-function + ;; TODO: a value of `nil' sorts it! That's not what the + ;; customize menu of `org-tags-sort-function' says! It + ;; says "No sorting". + ((or 'nil 'org-string<) + "group_a\ngroupless\nlonely\ntag_a_1\ntag_a_2\ntag_b_1\ntag_b_2\n") + ('org-string> + "tag_b_2\ntag_b_1\ntag_a_2\ntag_a_1\nlonely\ngroupless\ngroup_a\n")))))))) + (ert-deftest test-org-agenda/goto-date () "Test `org-agenda-goto-date'." (unwind-protect -- 2.45.1