[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote afe2bcaafe 4/7: Add test for denote-slug-keep-on
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote afe2bcaafe 4/7: Add test for denote-slug-keep-only-ascii |
Date: |
Tue, 3 Sep 2024 07:46:38 -0400 (EDT) |
branch: externals/denote
commit afe2bcaafe538e9f5ed59747e0fe27e650ad7ef6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add test for denote-slug-keep-only-ascii
---
denote.el | 2 +-
tests/denote-test.el | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index 72c39a0b1c..a1abc9dbaa 100644
--- a/denote.el
+++ b/denote.el
@@ -931,7 +931,7 @@ to override what this function returns."
;;;;; Sluggification functions
(defun denote-slug-keep-only-ascii (str)
- "Remove all non-ASCII characters from STR.
+ "Remove all non-ASCII characters from STR and replace them with spaces.
This is useful as a helper function to construct
`denote-file-name-slug-functions'."
(let* ((ascii-range (seq-map
diff --git a/tests/denote-test.el b/tests/denote-test.el
index 0bfa6aa108..a30d817ace 100644
--- a/tests/denote-test.el
+++ b/tests/denote-test.el
@@ -48,6 +48,12 @@ Concretely, replace with spaces anything that matches the
(should (equal (denote--slug-no-punct "This is !@# test")
"This is test")))
+(ert-deftest denote-test--denote-slug-keep-only-ascii ()
+ "Test that `denote-slug-keep-only-ascii' removes non-ASCII characters."
+ (should (equal
+ (denote-slug-keep-only-ascii "There are no-ASCII : characters |
here 😀")
+ "There are no-ASCII characters here ")))
+
(ert-deftest denote-test--denote--slug-hyphenate ()
"Test that `denote--slug-hyphenate' hyphenates the string.
Also replace multiple hyphens with a single one and remove any
- [elpa] externals/denote updated (e7cfd48bd6 -> 7743d02042), ELPA Syncer, 2024/09/03
- [elpa] externals/denote 1a1775acd2 3/7: Add function denote-slug-keep-only-ascii, ELPA Syncer, 2024/09/03
- [elpa] externals/denote b600e70857 1/7: Fix a typo in denote-kill-buffers, ELPA Syncer, 2024/09/03
- [elpa] externals/denote afe2bcaafe 4/7: Add test for denote-slug-keep-only-ascii,
ELPA Syncer <=
- [elpa] externals/denote 4c5d882f62 2/7: Add two more outline headings, ELPA Syncer, 2024/09/03
- [elpa] externals/denote 7743d02042 7/7: Add TODO for after version 3.1.0 (which is coming soon), ELPA Syncer, 2024/09/03
- [elpa] externals/denote 1975648e39 6/7: Document denote-slug-keep-only-ascii in the manual, ELPA Syncer, 2024/09/03
- [elpa] externals/denote 5180991464 5/7: Document custom functions to sluggify by removing non-ASCII characters, ELPA Syncer, 2024/09/03