aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-12-12 15:31:33 +0100
committerAndrea Corallo2020-12-12 15:31:33 +0100
commit0474fda62d79cb7eb250f34f19773c87f283c665 (patch)
treedf7418a6b22fbbfda725c56825ec0290f8e6be39 /test/src
parentbe907b0ba82c2a65e0468d50653cae8a7cf5f16b (diff)
parent4afef614cd6c93b4d4a57aa5bb211563649abc56 (diff)
downloademacs-0474fda62d79cb7eb250f34f19773c87f283c665.tar.gz
emacs-0474fda62d79cb7eb250f34f19773c87f283c665.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/src')
-rw-r--r--test/src/casefiddle-tests.el3
-rw-r--r--test/src/data-tests.el2
-rw-r--r--test/src/eval-tests.el17
-rw-r--r--test/src/fns-tests.el16
-rw-r--r--test/src/regex-emacs-tests.el64
5 files changed, 100 insertions, 2 deletions
diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el
index 7abb79eadde..3eba4cfd78b 100644
--- a/test/src/casefiddle-tests.el
+++ b/test/src/casefiddle-tests.el
@@ -247,7 +247,8 @@
247 ;; input upcase downcase [titlecase] 247 ;; input upcase downcase [titlecase]
248 (dolist (test '((?a ?A ?a) (?A ?A ?a) 248 (dolist (test '((?a ?A ?a) (?A ?A ?a)
249 (?ł ?Ł ?ł) (?Ł ?Ł ?ł) 249 (?ł ?Ł ?ł) (?Ł ?Ł ?ł)
250 (?ß ?ß ?ß) (?ẞ ?ẞ ?ß) 250 ;; We char-upcase ß to ẞ; see bug #11309.
251 (?ß ?ẞ ?ß) (?ẞ ?ẞ ?ß)
251 (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ) 252 (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ)
252 (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž))) 253 (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž)))
253 (let ((ch (car test)) 254 (let ((ch (car test))
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 1312683c848..c5fc3eaa11a 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -324,7 +324,7 @@ comparing the subr with a much slower lisp implementation."
324 324
325(defvar binding-test-some-local 'some) 325(defvar binding-test-some-local 'some)
326(with-current-buffer binding-test-buffer-A 326(with-current-buffer binding-test-buffer-A
327 (set (make-local-variable 'binding-test-some-local) 'local)) 327 (setq-local binding-test-some-local 'local))
328 328
329(ert-deftest binding-test-manual () 329(ert-deftest binding-test-manual ()
330 "A test case from the elisp manual." 330 "A test case from the elisp manual."
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 4125573dc6a..297db81f5ab 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -195,6 +195,23 @@ expressions works for identifiers starting with period."
195 (search-forward " foo()") 195 (search-forward " foo()")
196 (search-forward " normal-top-level()"))))) 196 (search-forward " normal-top-level()")))))
197 197
198(ert-deftest eval-tests/backtrace-in-batch-mode/inhibit ()
199 (let ((emacs (expand-file-name invocation-name invocation-directory)))
200 (skip-unless (file-executable-p emacs))
201 (with-temp-buffer
202 (let ((status (call-process
203 emacs nil t nil
204 "--quick" "--batch"
205 (concat "--eval="
206 (prin1-to-string
207 '(progn
208 (defun foo () (error "Boo"))
209 (let ((backtrace-on-error-noninteractive nil))
210 (foo))))))))
211 (should (natnump status))
212 (should-not (eql status 0)))
213 (should (equal (string-trim (buffer-string)) "Boo")))))
214
198(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors () 215(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors ()
199 (let ((emacs (expand-file-name invocation-name invocation-directory))) 216 (let ((emacs (expand-file-name invocation-name invocation-directory)))
200 (skip-unless (file-executable-p emacs)) 217 (skip-unless (file-executable-p emacs))
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 86b8d655d26..eaa569e0d95 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -983,3 +983,19 @@
983 (should (equal (string-search (string-to-multibyte "o\303\270") "foo\303\270") 983 (should (equal (string-search (string-to-multibyte "o\303\270") "foo\303\270")
984 2)) 984 2))
985 (should (equal (string-search "\303\270" "foo\303\270") 3))) 985 (should (equal (string-search "\303\270" "foo\303\270") 3)))
986
987(ert-deftest object-intervals ()
988 (should (equal (object-intervals (propertize "foo" 'bar 'zot))
989 '((0 3 (bar zot)))))
990 (should (equal (object-intervals (concat (propertize "foo" 'bar 'zot)
991 (propertize "foo" 'gazonk "gazonk")))
992 '((0 3 (bar zot)) (3 6 (gazonk "gazonk")))))
993 (should (equal
994 (with-temp-buffer
995 (insert "foobar")
996 (put-text-property 1 3 'foo 1)
997 (put-text-property 3 6 'bar 2)
998 (put-text-property 2 5 'zot 3)
999 (object-intervals (current-buffer)))
1000 '((0 1 (foo 1)) (1 2 (zot 3 foo 1)) (2 4 (zot 3 bar 2))
1001 (4 5 (bar 2)) (5 6 nil)))))
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index f9372e37b11..34d4067db47 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -803,4 +803,68 @@ This evaluates the TESTS test cases from glibc."
803 (should-not (string-match "å" "\xe5")) 803 (should-not (string-match "å" "\xe5"))
804 (should-not (string-match "[å]" "\xe5"))) 804 (should-not (string-match "[å]" "\xe5")))
805 805
806(ert-deftest regexp-case-fold ()
807 "Test case-sensitive and case-insensitive matching."
808 (let ((case-fold-search nil))
809 (should (equal (string-match "aB" "ABaB") 2))
810 (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 6))
811 (should (equal (string-match "λΛ" "lΛλλΛ") 3))
812 (should (equal (string-match "шШ" "zШшшШ") 3))
813 (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
814 (should (equal (match-end 0) 12))
815 (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
816 (should (equal (match-end 0) 12))
817 (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 6))
818 (should (equal (match-end 0) 10))
819 (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 6))
820 (should (equal (match-end 0) 10)))
821 (let ((case-fold-search t))
822 (should (equal (string-match "aB" "ABaB") 0))
823 (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 0))
824 (should (equal (string-match "λΛ" "lΛλλΛ") 1))
825 (should (equal (string-match "шШ" "zШшшШ") 1))
826 (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2))
827 (should (equal (match-end 0) 12))
828 (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1))
829 (should (equal (match-end 0) 12))
830 (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 2))
831 (should (equal (match-end 0) 10))
832 (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 2))
833 (should (equal (match-end 0) 10))))
834
835(ert-deftest regexp-eszett ()
836 "Test matching of ß and ẞ."
837 ;; Sanity checks.
838 (should (equal (upcase "ß") "SS"))
839 (should (equal (downcase "ß") "ß"))
840 (should (equal (capitalize "ß") "Ss")) ; undeutsch...
841 (should (equal (upcase "ẞ") "ẞ"))
842 (should (equal (downcase "ẞ") "ß"))
843 (should (equal (capitalize "ẞ") "ẞ"))
844 ;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu).
845 (let ((case-fold-search nil))
846 (should (equal (string-match "ß" "ß") 0))
847 (should (equal (string-match "ß" "ẞ") nil))
848 (should (equal (string-match "ẞ" "ß") nil))
849 (should (equal (string-match "ẞ" "ẞ") 0))
850 (should (equal (string-match "[[:alpha:]]" "ß") 0))
851 ;; bug#11309
852 (should (equal (string-match "[[:lower:]]" "ß") 0))
853 (should (equal (string-match "[[:upper:]]" "ß") nil))
854 (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
855 (should (equal (string-match "[[:lower:]]" "ẞ") nil))
856 (should (equal (string-match "[[:upper:]]" "ẞ") 0)))
857 (let ((case-fold-search t))
858 (should (equal (string-match "ß" "ß") 0))
859 (should (equal (string-match "ß" "ẞ") 0))
860 (should (equal (string-match "ẞ" "ß") 0))
861 (should (equal (string-match "ẞ" "ẞ") 0))
862 (should (equal (string-match "[[:alpha:]]" "ß") 0))
863 ;; bug#11309
864 (should (equal (string-match "[[:lower:]]" "ß") 0))
865 (should (equal (string-match "[[:upper:]]" "ß") 0))
866 (should (equal (string-match "[[:alpha:]]" "ẞ") 0))
867 (should (equal (string-match "[[:lower:]]" "ẞ") 0))
868 (should (equal (string-match "[[:upper:]]" "ẞ") 0))))
869
806;;; regex-emacs-tests.el ends here 870;;; regex-emacs-tests.el ends here