emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 3a35d3f6cf 1/2: denote-test: fix denote-test--de


From: ELPA Syncer
Subject: [elpa] externals/denote 3a35d3f6cf 1/2: denote-test: fix denote-test--denote-file-is-note-p
Date: Mon, 22 May 2023 23:58:14 -0400 (EDT)

branch: externals/denote
commit 3a35d3f6cfc8d5bbfc17a93de838e2f5c6b24155
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    denote-test: fix denote-test--denote-file-is-note-p
---
 tests/denote-test.el | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/tests/denote-test.el b/tests/denote-test.el
index 371ffed9b0..5bc3f50a3c 100644
--- a/tests/denote-test.el
+++ b/tests/denote-test.el
@@ -124,21 +124,20 @@ The function also account for the value of the user option
                 (denote--file-empty-p file)
               (delete-file file)))))
 
-;; FIXME 2023-05-22: It does not return non-nil even though I am
-;; giving it what should be a file in `denote-directory'.
-;; (ert-deftest denote-test--denote-file-is-note-p ()
-
-;;   "Test that `denote-file-is-note-p' checks that files is a Denote note.
-;; For our purposes, a note must note be a directory, must satisfy
-;; `file-regular-p', its path must be part of the variable
-;; `denote-directory', it must have a Denote identifier in its name,
-;; and use one of the extensions implied by `denote-file-type'."
-;;   (should (let* ((tmp (temporary-file-directory))
-;;                  (denote-directory tmp)
-;;                  (file (concat tmp "20230522T154900--test__keyword.txt")))
-;;             (prog1
-;;                 (denote-file-is-note-p file)
-;;               (delete-file file)))))
+(ert-deftest denote-test--denote-file-is-note-p ()
+  "Test that `denote-file-is-note-p' checks that files is a Denote note.
+For our purposes, a note must note be a directory, must satisfy
+`file-regular-p', its path must be part of the variable
+`denote-directory', it must have a Denote identifier in its name,
+and use one of the extensions implied by `denote-file-type'."
+  (should (let* ((tmp (temporary-file-directory))
+                 (denote-directory tmp)
+                 (file (concat tmp "20230522T154900--test__keyword.txt")))
+            (with-current-buffer (find-file-noselect file)
+              (write-file file))
+            (prog1
+                (denote-file-is-note-p file)
+              (delete-file file)))))
 
 (ert-deftest denote-test--denote-file-has-identifier-p ()
   "Test that `denote-file-has-identifier-p' checks for a Denote identifier."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]