summaryrefslogtreecommitdiff
path: root/test/lisp/char-fold-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/char-fold-tests.el')
-rw-r--r--test/lisp/char-fold-tests.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/lisp/char-fold-tests.el b/test/lisp/char-fold-tests.el
index d86c731b6e3..00bc3c83d05 100644
--- a/test/lisp/char-fold-tests.el
+++ b/test/lisp/char-fold-tests.el
@@ -54,6 +54,14 @@
(concat w1 "\s\n\s\t\f\t\n\r\t" w2)
(concat w1 (make-string 10 ?\s) w2)))))
+(defun char-fold--ascii-upcase (string)
+ "Like `upcase' but acts on ASCII characters only."
+ (replace-regexp-in-string "[a-z]+" 'upcase string))
+
+(defun char-fold--ascii-downcase (string)
+ "Like `downcase' but acts on ASCII characters only."
+ (replace-regexp-in-string "[a-z]+" 'downcase string))
+
(defun char-fold--test-match-exactly (string &rest strings-to-match)
(let ((re (concat "\\`" (char-fold-to-regexp string) "\\'")))
(dolist (it strings-to-match)
@@ -61,8 +69,8 @@
;; Case folding
(let ((case-fold-search t))
(dolist (it strings-to-match)
- (should (string-match (upcase re) (downcase it)))
- (should (string-match (downcase re) (upcase it)))))))
+ (should (string-match (char-fold--ascii-upcase re) (downcase it)))
+ (should (string-match (char-fold--ascii-downcase re) (upcase it)))))))
(ert-deftest char-fold--test-some-defaults ()
(dolist (it '(("ffl" . "ffl") ("ffi" . "ffi")