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 wMgyDUKK6mCrSwEAgWs5BA (envelope-from ) for ; Sun, 11 Jul 2021 08:05:54 +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 kP/aCEKK6mBoLwAA1q6Kng (envelope-from ) for ; Sun, 11 Jul 2021 06:05:54 +0000 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 7ADDB207B5 for ; Sun, 11 Jul 2021 08:05:53 +0200 (CEST) Received: from localhost ([::1]:46098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2SbA-0006Tl-Jp for larch@yhetil.org; Sun, 11 Jul 2021 02:05:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Sa9-0006R5-PR for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 02:04:50 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:42528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2Sa7-00035p-7j for emacs-orgmode@gnu.org; Sun, 11 Jul 2021 02:04:49 -0400 Received: by mail-lj1-x231.google.com with SMTP id r16so16737265ljk.9 for ; Sat, 10 Jul 2021 23:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=DR6lFIlUaRK8pkAEEWA2kT5OSUpNyvUHdeU2x/HvNAk=; b=sp++NxPCHQxQm/vJxz0lRabTRaIeDAiIb62DIFmLZuHn4IJNOOwskcGMy0PAwUSnDj 8Z/Ip3dGNr3FfRTGC1/XtHjw3XA8PNSKabbZzoq1gP/JIODLWkSCaZIABBKuW07gYHue 1NWQEMduYWV8ZB6fJbzR/yZqdFiBobay/EKGVP8NR23qbyczwsqDFdHMKE9Glcksixiq ppgPF/hGJP+bUmfWENY9uHfLjk9/6cRiuDR2YDpIdkpPTV0c9Ap0YQnZXLQAROtc5HQk asSLXf74JzXKHVdbWVieii3ePao8Ow/0MOZMnemBspV60xbph2mnR+5kwTHGs731G+/K JLHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=DR6lFIlUaRK8pkAEEWA2kT5OSUpNyvUHdeU2x/HvNAk=; b=LOfKDt0jM99cZ3TsguDkgpRmpRlOEaBqXwc8Ci4C5x86tIF3TkyLWEjx2Rs2sFortV WYo+/mZH8krIVNZ/PfjZdRfwZ2RCNnK9YN+xHgrWQytOoBi1MdFbOaVdhWigZ7dKtadT iDTIB8CcCtJL8MoejR380p7a1Mt0+D9lA5iZKXFJGywZ74Af8JqnGrA1NodVzoQoEJdH J1EaBru/yxAfSqoHV7wB2xJn3aKF/a4xNyd52RM3gjz/kua401gC7DXKkAI2/VdjXhNJ uDFow0raOGEdL7d8PQ3D1FTiJ7qjR84l1uXPQrvUmVnS26JvTaRp0x+1JTp9U4YLjTjo dWRQ== X-Gm-Message-State: AOAM530oLpcTKxmSU/r0B+V/DZ1tIwZ/7j/pc8v6pv52L9RqsNRDaCXd WI96mibidUaaPRbg2l+gHFGBEgcTRnU= X-Google-Smtp-Source: ABdhPJwJftJ6Ns+qn7bPH4Mz5ZOfZAAeWXOooi5RQzszr6/aGipqlZMF2lgNVUQtNcY8N7aJee02EA== X-Received: by 2002:a05:651c:211a:: with SMTP id a26mr24942318ljq.91.1625983484589; Sat, 10 Jul 2021 23:04:44 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id w17sm871051lfd.126.2021.07.10.23.04.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 23:04:43 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH] Add test checking org-log-done specs Date: Sun, 11 Jul 2021 14:04:47 +0800 Message-ID: <87tul1v11c.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=yantar92@gmail.com; helo=mail-lj1-x231.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625983554; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jkmu7yhrQ6Vrg4IqQaMzxSjEnSq1RyTq8+BC716PBMg=; b=mqihT/aNMTcu1zzanibzB9S9A53TrnTXJChEOcoFHw6+G5Ci7TVoHbLSdwknVmIuF7JIWy F3W9c4zgcds6uzS0CRaTvtZWPr/uQGkp1mSz6Oq4+tB1Rcl18MzqMQHrCOFPGXyY6NqAwg BeCHfUqRYm6ROtzQIZw3OjxEUPJknrLhbxCpEsduo6wSZmaTARh4xt3hSDxhImdBMHY7uJ XBTDf0f8cSBRp2SJ9mufaUp/Kv541z6Ca94Q+/CoO+6OpJiRC70/PJ/OJ30BIqciqHC1yF icDlcICoBcSXunDecMvj9FIpZuOpci7G+WAOjOIAOjiFX/qx0siOgGF0goi2KQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625983554; a=rsa-sha256; cv=none; b=fns9bvCh2HQ5O2L8QJU4GmPQp2NdZ6pWKvk0dZIIrWCW8Y5rVTaUY6t9RWqEXVKRRR4FZq LXLFqg9BOL53ZSZr++snAvV4ONZ+mBAvKZ8vp1YT2vTBeq4MTNn7mE4eN3M4eOE1+RuucL PoKQCDjQEBQR4eDgY3ZBViIYplQlteMqZzKpobOOLaKUjMbr+W2PI4qYJ0/1vrDhQEJdB5 zClcGmzZ36u27IeJSVipKYQyDQRoO5KSZND9koSeXitnBpnx+OeTBQXy5KBwg7o8MUgK8v laTY6/Les4m67Q27SZud40itSC0xujQTk6+9x4UzHF3eE/DwA6eLarAHjqC6aw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=sp++NxPC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 0.80 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=sp++NxPC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7ADDB207B5 X-Spam-Score: 0.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: RJhtw0PKt/tH --=-=-= Content-Type: text/plain Hi, I did not find any tests checking logging specifications of Org mode. Attached is an example implementation of such test for org-log-done specs. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-test-checking-org-log-done-specs.patch >From 2a58a82520de57142c6a397d811290f19789635f Mon Sep 17 00:00:00 2001 Message-Id: <2a58a82520de57142c6a397d811290f19789635f.1625983309.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sun, 11 Jul 2021 13:38:07 +0800 Subject: [PATCH] Add test checking org-log-done specs * testing/lisp/test-org.el (test-org/org-log-done): New test --- testing/lisp/test-org.el | 126 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index c2267c32d..6922cbb4f 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -7418,6 +7418,132 @@ (ert-deftest test-org/auto-repeat-maybe () (org-add-log-note)) (buffer-string)))))) +(ert-deftest test-org/org-log-done () + "Test `org-log-done' specifications." + ;; nil value. + (should + (string= + "* DONE task" + (let ((org-log-done nil) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "* TODO task" + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + ;; `time' value. + (should + (string= + (format + "* DONE task +CLOSED: %s" + (org-test-with-temp-text "" + (org-insert-time-stamp (current-time) t t) + (buffer-string))) + (let ((org-log-done 'time) + (org-log-done-with-time t) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "* TODO task" + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + (should + (string= + (format + "* DONE task +CLOSED: %s" + (org-test-with-temp-text "" + (org-insert-time-stamp (current-time) nil t) + (buffer-string))) + (let ((org-log-done 'time) + (org-log-done-with-time nil) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "* TODO task" + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + ;; TODO: Test `note' value. + ;; Test startup overrides. + (should + (string= + "#+STARTUP: nologdone +* DONE task" + (let ((org-log-done 'time) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "#+STARTUP: nologdone +* TODO task" + (org-set-regexps-and-options) + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + (should + (string= + (format + "#+STARTUP: logdone +* DONE task +CLOSED: %s" + (org-test-with-temp-text "" + (org-insert-time-stamp (current-time) t t) + (buffer-string))) + (let ((org-log-done nil) + (org-log-done-with-time t) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "#+STARTUP: logdone +* TODO task" + (org-set-regexps-and-options) + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + ;; Test local property overrides. + (should + (string= + "* DONE task +:PROPERTIES: +:LOGGING: nil +:END:" + (let ((org-log-done 'time) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "* TODO task +:PROPERTIES: +:LOGGING: nil +:END:" + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string))))) + (should + (string= + (format + "* DONE task +CLOSED: %s +:PROPERTIES: +:LOGGING: logdone +:END:" + (org-test-with-temp-text "" + (org-insert-time-stamp (current-time) t t) + (buffer-string))) + (let ((org-log-done nil) + (org-log-done-with-time t) + (org-todo-keywords '((sequence "TODO" "DONE")))) + (org-test-with-temp-text + "* TODO task +:PROPERTIES: +:LOGGING: logdone +:END:" + (org-todo "DONE") + (when (memq 'org-add-log-note post-command-hook) + (org-add-log-note)) + (buffer-string)))))) ;;; Timestamps API -- 2.31.1 --=-=-=--