aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArtur Malabarba2015-11-28 15:31:43 +0000
committerArtur Malabarba2015-11-28 16:21:54 +0000
commit19141a9be607cf88641c8b90cf494cf5913de49f (patch)
tree052fab897ef5b38f0b1d1999389a4c7de88e0afe /test
parent5c5997002b0b0aded744d5828158243fd546b3ec (diff)
downloademacs-19141a9be607cf88641c8b90cf494cf5913de49f.tar.gz
emacs-19141a9be607cf88641c8b90cf494cf5913de49f.zip
* lisp/character-fold.el: Also play nice with case-folding
(character-fold-to-regexp): Take `case-fold-search' into account.
Diffstat (limited to 'test')
-rw-r--r--test/automated/character-fold-tests.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/automated/character-fold-tests.el b/test/automated/character-fold-tests.el
index aa2ee96a7a4..3a288b9071c 100644
--- a/test/automated/character-fold-tests.el
+++ b/test/automated/character-fold-tests.el
@@ -37,7 +37,7 @@
37 37
38 38
39(ert-deftest character-fold--test-consistency () 39(ert-deftest character-fold--test-consistency ()
40 (dotimes (n 100) 40 (dotimes (n 50)
41 (let ((w (character-fold--random-word n))) 41 (let ((w (character-fold--random-word n)))
42 ;; A folded string should always match the original string. 42 ;; A folded string should always match the original string.
43 (character-fold--test-search-with-contents w w)))) 43 (character-fold--test-search-with-contents w w))))
@@ -57,7 +57,12 @@
57(defun character-fold--test-match-exactly (string &rest strings-to-match) 57(defun character-fold--test-match-exactly (string &rest strings-to-match)
58 (let ((re (concat "\\`" (character-fold-to-regexp string) "\\'"))) 58 (let ((re (concat "\\`" (character-fold-to-regexp string) "\\'")))
59 (dolist (it strings-to-match) 59 (dolist (it strings-to-match)
60 (should (string-match re it))))) 60 (should (string-match re it)))
61 ;; Case folding
62 (let ((case-fold-search t))
63 (dolist (it strings-to-match)
64 (should (string-match (upcase re) (downcase it)))
65 (should (string-match (downcase re) (upcase it)))))))
61 66
62(ert-deftest character-fold--test-some-defaults () 67(ert-deftest character-fold--test-some-defaults ()
63 (dolist (it '(("ffl" . "ffl") ("ffi" . "ffi") 68 (dolist (it '(("ffl" . "ffl") ("ffi" . "ffi")