mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Add test for denote-slug-keep-only-ascii
This commit is contained in:
parent
1a1775acd2
commit
afe2bcaafe
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue