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

[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



reply via email to

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