[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote a0188e7cba 05/11: Expand tests to also cover alp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote a0188e7cba 05/11: Expand tests to also cover alphanumeric child sequences |
Date: |
Sun, 12 Jan 2025 06:58:06 -0500 (EST) |
branch: externals/denote
commit a0188e7cba94fe8caf2c0c309dc4a4218564ff5e
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Expand tests to also cover alphanumeric child sequences
---
tests/denote-test.el | 46 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/tests/denote-test.el b/tests/denote-test.el
index 9a5fa808d5..b36f098d14 100644
--- a/tests/denote-test.el
+++ b/tests/denote-test.el
@@ -594,8 +594,9 @@ does not involve the time zone."
;; TODO 2024-12-31: Maybe we can share some state between tests? It
;; is expensive to create those files over and over.
-(ert-deftest dt-denote-sequence--get-new-child ()
- "Make sure `denote-sequence--get-new-child' gets the child of a sequence."
+(ert-deftest dt-denote-sequence--get-new-child-numeric ()
+ "Make sure `denote-sequence--get-new-child' gets the child of a sequence.
+This is done using the numeric `denote-sequence-scheme'."
(let* ((denote-directory (expand-file-name "denote-test"
temporary-file-directory))
(files
(mapcar
@@ -613,9 +614,7 @@ does not involve the time zone."
"20241230T075023==1=1=2--test__testing.txt"
"20241230T075023==1=2--test__testing.txt"
"20241230T075023==1=2=1--test__testing.txt"
- "20241230T075023==2--test__testing.txt"
- "20241230T075023==45--test__testing.txt"
- "20241230T075023==45=1--test__testing.txt")))
+ "20241230T075023==2--test__testing.txt")))
(sequences (denote-sequence-get-all-sequences files)))
(let ((denote-sequence-scheme 'numeric))
(should
@@ -625,8 +624,41 @@ does not involve the time zone."
(equal (denote-sequence--get-new-child "1=1=2" sequences) "1=1=2=1")
(equal (denote-sequence--get-new-child "1=2" sequences) "1=2=2")
(equal (denote-sequence--get-new-child "1=2=1" sequences) "1=2=1=1")
- (equal (denote-sequence--get-new-child "2" sequences) "2=1")
- (equal (denote-sequence--get-new-child "45" sequences) "45=2")))
+ (equal (denote-sequence--get-new-child "2" sequences) "2=1")))
+ (should-error (denote-sequence--get-new-child "3" sequences)))
+ (delete-directory denote-directory :delete-contents-as-well)))
+
+(ert-deftest dt-denote-sequence--get-new-child-alphanumeric ()
+ "Make sure `denote-sequence--get-new-child' gets the child of a sequence.
+This is done using the alphanumeric `denote-sequence-scheme'."
+ (let* ((denote-directory (expand-file-name "denote-test"
temporary-file-directory))
+ (files
+ (mapcar
+ (lambda (file)
+ (let ((path (expand-file-name file (denote-directory))))
+ (if (file-exists-p path)
+ path
+ (with-current-buffer (find-file-noselect path)
+ (save-buffer)
+ (kill-buffer (current-buffer)))
+ path)))
+ '("20241230T075004==1--some-new-title__testing.txt"
+ "20241230T075023==1a--child-of-note__testing.txt"
+ "20241230T075023==1a1--test__testing.txt"
+ "20241230T075023==1a2--test__testing.txt"
+ "20241230T075023==1b--test__testing.txt"
+ "20241230T075023==1b1--test__testing.txt"
+ "20241230T075023==2--test__testing.txt")))
+ (sequences (denote-sequence-get-all-sequences files)))
+ (let ((denote-sequence-scheme 'alphanumeric))
+ (should
+ (and
+ (equal (denote-sequence--get-new-child "1" sequences) "1c")
+ (equal (denote-sequence--get-new-child "1a" sequences) "1a3")
+ (equal (denote-sequence--get-new-child "1a2" sequences) "1a2a")
+ (equal (denote-sequence--get-new-child "1b" sequences) "1b2")
+ (equal (denote-sequence--get-new-child "1b1" sequences) "1b1a")
+ (equal (denote-sequence--get-new-child "2" sequences) "2a")))
(should-error (denote-sequence--get-new-child "3" sequences)))
(delete-directory denote-directory :delete-contents-as-well)))
- [elpa] externals/denote updated (913571e79e -> 4e62c3f2b6), ELPA Syncer, 2025/01/12
- [elpa] externals/denote 14dd0b5d2e 03/11: Make denote-sequence--get-new-child work with alphanumeric sequences, ELPA Syncer, 2025/01/12
- [elpa] externals/denote a0188e7cba 05/11: Expand tests to also cover alphanumeric child sequences,
ELPA Syncer <=
- [elpa] externals/denote a4d3d62b26 10/11: Clarify how denote-sequence can be loaded, ELPA Syncer, 2025/01/12
- [elpa] externals/denote 182db0675e 06/11: Expand tests to also cover alphanumeric sibling sequences, ELPA Syncer, 2025/01/12
- [elpa] externals/denote 26f43c8aec 07/11: Make denote-sequence-alphanumeric-p require numeric prefix, ELPA Syncer, 2025/01/12
- [elpa] externals/denote 4997e6b007 02/11: Rename denote-sequence-get-sequences-with-max-depth to include "all", ELPA Syncer, 2025/01/12
- [elpa] externals/denote b642758ff9 04/11: Ensure the sequence tests target the implied scheme, ELPA Syncer, 2025/01/12
- [elpa] externals/denote 6e9473cd4f 09/11: Merge branch 'alphanumeric-sequence-extension', ELPA Syncer, 2025/01/12
- [elpa] externals/denote 43bd30e6eb 01/11: Make the groundwork for alphanumeric (Luhmann) sequences in denote-sequence.el, ELPA Syncer, 2025/01/12
- [elpa] externals/denote a717f46eee 08/11: Make denote-sequence-convert also convert complete sequences, ELPA Syncer, 2025/01/12
- [elpa] externals/denote 4e62c3f2b6 11/11: Rewrite and expand the manual about denote-sequence.el, ELPA Syncer, 2025/01/12