aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorK. Handa2015-09-08 20:43:11 +0900
committerK. Handa2015-09-08 20:43:11 +0900
commit94ed5167557112fb00eeca05e62589db744206de (patch)
tree80a544f8534802dd61fbd218b97441d3419dbf6b /test
parent33f2e0023a5ef03db3e99ade0b93a7a1a913dbe1 (diff)
parent10e7f7de910ca816799062f33b830f7598801f0e (diff)
downloademacs-94ed5167557112fb00eeca05e62589db744206de.tar.gz
emacs-94ed5167557112fb00eeca05e62589db744206de.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'test')
-rw-r--r--test/automated/Makefile.in8
-rw-r--r--test/automated/flymake-tests.el1
-rw-r--r--test/automated/map-tests.el44
-rw-r--r--test/automated/python-tests.el21
-rw-r--r--test/automated/seq-tests.el21
-rw-r--r--test/automated/textprop-tests.el2
-rw-r--r--test/automated/tildify-tests.el3
7 files changed, 58 insertions, 42 deletions
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index 174b3b6dffe..59a88663e2a 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -52,9 +52,15 @@ unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
52## To run tests under a debugger, set this to eg: "gdb --args". 52## To run tests under a debugger, set this to eg: "gdb --args".
53GDB = 53GDB =
54 54
55# The locale to run tests under. Tests should work if this is set to
56# any supported locale. Use the C locale by default, as it should be
57# supported everywhere.
58TEST_LOCALE = C
59
55# The actual Emacs command run in the targets below. 60# The actual Emacs command run in the targets below.
56# Prevent any setting of EMACSLOADPATH in user environment causing problems. 61# Prevent any setting of EMACSLOADPATH in user environment causing problems.
57emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) $(GDB) "$(EMACS)" $(EMACSOPT) 62emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) EMACS_TEST_DIRECTORY=$(srcdir) \
63 $(GDB) "$(EMACS)" $(EMACSOPT)
58 64
59.PHONY: all check 65.PHONY: all check
60 66
diff --git a/test/automated/flymake-tests.el b/test/automated/flymake-tests.el
index 23dbb3d010c..a77c31638a5 100644
--- a/test/automated/flymake-tests.el
+++ b/test/automated/flymake-tests.el
@@ -34,6 +34,7 @@
34(defun flymake-tests--current-face (file predicate) 34(defun flymake-tests--current-face (file predicate)
35 (let ((buffer (find-file-noselect 35 (let ((buffer (find-file-noselect
36 (expand-file-name file flymake-tests-data-directory))) 36 (expand-file-name file flymake-tests-data-directory)))
37 (process-environment (cons "LC_ALL=C" process-environment))
37 (i 0)) 38 (i 0))
38 (unwind-protect 39 (unwind-protect
39 (with-current-buffer buffer 40 (with-current-buffer buffer
diff --git a/test/automated/map-tests.el b/test/automated/map-tests.el
index 1f3a07e3f3b..8693415a784 100644
--- a/test/automated/map-tests.el
+++ b/test/automated/map-tests.el
@@ -252,31 +252,29 @@ Evaluate BODY for each created map.
252 (should (not (map-empty-p "hello"))) 252 (should (not (map-empty-p "hello")))
253 (should (map-empty-p ""))) 253 (should (map-empty-p "")))
254 254
255(ert-deftest test-map-contains-key-p () 255(ert-deftest test-map-contains-key ()
256 (should (map-contains-key-p '((a . 1) (b . 2)) 'a)) 256 (should (map-contains-key '((a . 1) (b . 2)) 'a))
257 (should (not (map-contains-key-p '((a . 1) (b . 2)) 'c))) 257 (should (not (map-contains-key '((a . 1) (b . 2)) 'c)))
258 (should (map-contains-key-p '(("a" . 1)) "a")) 258 (should (map-contains-key '(("a" . 1)) "a"))
259 (should (not (map-contains-key-p '(("a" . 1)) "a" #'eq))) 259 (should (not (map-contains-key '(("a" . 1)) "a" #'eq)))
260 (should (map-contains-key-p [a b c] 2)) 260 (should (map-contains-key [a b c] 2))
261 (should (not (map-contains-key-p [a b c] 3)))) 261 (should (not (map-contains-key [a b c] 3))))
262 262
263(ert-deftest test-map-some-p () 263(ert-deftest test-map-some ()
264 (with-maps-do map 264 (with-maps-do map
265 (should (equal (map-some-p (lambda (k _v) 265 (should (map-some (lambda (k _v)
266 (eq 1 k)) 266 (eq 1 k))
267 map) 267 map))
268 (cons 1 4))) 268 (should-not (map-some (lambda (k _v)
269 (should (not (map-some-p (lambda (k _v) 269 (eq 'd k))
270 (eq 'd k)) 270 map)))
271 map))))
272 (let ((vec [a b c])) 271 (let ((vec [a b c]))
273 (should (equal (map-some-p (lambda (k _v) 272 (should (map-some (lambda (k _v)
274 (> k 1)) 273 (> k 1))
275 vec) 274 vec))
276 (cons 2 'c))) 275 (should-not (map-some (lambda (k _v)
277 (should (not (map-some-p (lambda (k _v) 276 (> k 3))
278 (> k 3)) 277 vec))))
279 vec)))))
280 278
281(ert-deftest test-map-every-p () 279(ert-deftest test-map-every-p ()
282 (with-maps-do map 280 (with-maps-do map
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 219f99eed62..d9b4c3e1b06 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -2920,7 +2920,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2920 :type 'user-error))) 2920 :type 'user-error)))
2921 (should 2921 (should
2922 (string= (cadr error-data) 2922 (string= (cadr error-data)
2923 "Invalid regexp \\( in `python-shell-prompt-input-regexps'")))) 2923 (format-message
2924 "Invalid regexp \\( in `python-shell-prompt-input-regexps'")))))
2924 2925
2925(ert-deftest python-shell-prompt-validate-regexps-2 () 2926(ert-deftest python-shell-prompt-validate-regexps-2 ()
2926 "Check `python-shell-prompt-output-regexps' are validated." 2927 "Check `python-shell-prompt-output-regexps' are validated."
@@ -2929,7 +2930,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2929 :type 'user-error))) 2930 :type 'user-error)))
2930 (should 2931 (should
2931 (string= (cadr error-data) 2932 (string= (cadr error-data)
2932 "Invalid regexp \\( in `python-shell-prompt-output-regexps'")))) 2933 (format-message
2934 "Invalid regexp \\( in `python-shell-prompt-output-regexps'")))))
2933 2935
2934(ert-deftest python-shell-prompt-validate-regexps-3 () 2936(ert-deftest python-shell-prompt-validate-regexps-3 ()
2935 "Check `python-shell-prompt-regexp' is validated." 2937 "Check `python-shell-prompt-regexp' is validated."
@@ -2938,7 +2940,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2938 :type 'user-error))) 2940 :type 'user-error)))
2939 (should 2941 (should
2940 (string= (cadr error-data) 2942 (string= (cadr error-data)
2941 "Invalid regexp \\( in `python-shell-prompt-regexp'")))) 2943 (format-message
2944 "Invalid regexp \\( in `python-shell-prompt-regexp'")))))
2942 2945
2943(ert-deftest python-shell-prompt-validate-regexps-4 () 2946(ert-deftest python-shell-prompt-validate-regexps-4 ()
2944 "Check `python-shell-prompt-block-regexp' is validated." 2947 "Check `python-shell-prompt-block-regexp' is validated."
@@ -2947,7 +2950,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2947 :type 'user-error))) 2950 :type 'user-error)))
2948 (should 2951 (should
2949 (string= (cadr error-data) 2952 (string= (cadr error-data)
2950 "Invalid regexp \\( in `python-shell-prompt-block-regexp'")))) 2953 (format-message
2954 "Invalid regexp \\( in `python-shell-prompt-block-regexp'")))))
2951 2955
2952(ert-deftest python-shell-prompt-validate-regexps-5 () 2956(ert-deftest python-shell-prompt-validate-regexps-5 ()
2953 "Check `python-shell-prompt-pdb-regexp' is validated." 2957 "Check `python-shell-prompt-pdb-regexp' is validated."
@@ -2956,7 +2960,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2956 :type 'user-error))) 2960 :type 'user-error)))
2957 (should 2961 (should
2958 (string= (cadr error-data) 2962 (string= (cadr error-data)
2959 "Invalid regexp \\( in `python-shell-prompt-pdb-regexp'")))) 2963 (format-message
2964 "Invalid regexp \\( in `python-shell-prompt-pdb-regexp'")))))
2960 2965
2961(ert-deftest python-shell-prompt-validate-regexps-6 () 2966(ert-deftest python-shell-prompt-validate-regexps-6 ()
2962 "Check `python-shell-prompt-output-regexp' is validated." 2967 "Check `python-shell-prompt-output-regexp' is validated."
@@ -2965,7 +2970,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2965 :type 'user-error))) 2970 :type 'user-error)))
2966 (should 2971 (should
2967 (string= (cadr error-data) 2972 (string= (cadr error-data)
2968 "Invalid regexp \\( in `python-shell-prompt-output-regexp'")))) 2973 (format-message
2974 "Invalid regexp \\( in `python-shell-prompt-output-regexp'")))))
2969 2975
2970(ert-deftest python-shell-prompt-validate-regexps-7 () 2976(ert-deftest python-shell-prompt-validate-regexps-7 ()
2971 "Check default regexps are valid." 2977 "Check default regexps are valid."
@@ -2982,7 +2988,8 @@ and `python-shell-interpreter-args' in the new shell buffer."
2982 :type 'user-error))) 2988 :type 'user-error)))
2983 (should 2989 (should
2984 (string= (cadr error-data) 2990 (string= (cadr error-data)
2985 "Invalid regexp \\( in `python-shell-prompt-output-regexp'")))) 2991 (format-message
2992 "Invalid regexp \\( in `python-shell-prompt-output-regexp'")))))
2986 2993
2987(ert-deftest python-shell-prompt-set-calculated-regexps-2 () 2994(ert-deftest python-shell-prompt-set-calculated-regexps-2 ()
2988 "Check `python-shell-prompt-input-regexps' are set." 2995 "Check `python-shell-prompt-input-regexps' are set."
diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el
index 482daeecb98..07a183d024e 100644
--- a/test/automated/seq-tests.el
+++ b/test/automated/seq-tests.el
@@ -129,21 +129,22 @@ Evaluate BODY for each created sequence.
129 (should (eq (seq-reduce #'+ seq 0) 0)) 129 (should (eq (seq-reduce #'+ seq 0) 0))
130 (should (eq (seq-reduce #'+ seq 7) 7)))) 130 (should (eq (seq-reduce #'+ seq 7) 7))))
131 131
132(ert-deftest test-seq-some-p () 132(ert-deftest test-seq-some ()
133 (with-test-sequences (seq '(4 3 2 1)) 133 (with-test-sequences (seq '(4 3 2 1))
134 (should (= (seq-some-p #'test-sequences-evenp seq) 4)) 134 (should (seq-some #'test-sequences-evenp seq))
135 (should (= (seq-some-p #'test-sequences-oddp seq) 3)) 135 (should (seq-some #'test-sequences-oddp seq))
136 (should-not (seq-some-p (lambda (elt) (> elt 10)) seq))) 136 (should-not (seq-some (lambda (elt) (> elt 10)) seq)))
137 (with-test-sequences (seq '()) 137 (with-test-sequences (seq '())
138 (should-not (seq-some-p #'test-sequences-oddp seq)))) 138 (should-not (seq-some #'test-sequences-oddp seq)))
139 (should (seq-some #'null '(1 nil 2))))
139 140
140(ert-deftest test-seq-contains-p () 141(ert-deftest test-seq-contains ()
141 (with-test-sequences (seq '(3 4 5 6)) 142 (with-test-sequences (seq '(3 4 5 6))
142 (should (seq-contains-p seq 3)) 143 (should (seq-contains seq 3))
143 (should-not (seq-contains-p seq 7))) 144 (should-not (seq-contains seq 7)))
144 (with-test-sequences (seq '()) 145 (with-test-sequences (seq '())
145 (should-not (seq-contains-p seq 3)) 146 (should-not (seq-contains seq 3))
146 (should-not (seq-contains-p seq nil)))) 147 (should-not (seq-contains seq nil))))
147 148
148(ert-deftest test-seq-every-p () 149(ert-deftest test-seq-every-p ()
149 (with-test-sequences (seq '(43 54 22 1)) 150 (with-test-sequences (seq '(43 54 22 1))
diff --git a/test/automated/textprop-tests.el b/test/automated/textprop-tests.el
index f6604fb8ff5..0baa911421b 100644
--- a/test/automated/textprop-tests.el
+++ b/test/automated/textprop-tests.el
@@ -25,7 +25,7 @@
25(require 'ert) 25(require 'ert)
26 26
27(ert-deftest textprop-tests-format () 27(ert-deftest textprop-tests-format ()
28 "Test format with text properties." 28 "Test `format' with text properties."
29 ;; See Bug#21351. 29 ;; See Bug#21351.
30 (should (equal-including-properties 30 (should (equal-including-properties
31 (format #("mouse-1, RET: %s -- w: copy %s" 31 (format #("mouse-1, RET: %s -- w: copy %s"
diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el
index b53f58c279e..788abe7f731 100644
--- a/test/automated/tildify-tests.el
+++ b/test/automated/tildify-tests.el
@@ -55,6 +55,7 @@ If IS-XML is non-nil, <pre> tag is not treated specially."
55INPUT is the initial content of the buffer and EXPECTED is expected result 55INPUT is the initial content of the buffer and EXPECTED is expected result
56after `tildify-buffer' is run." 56after `tildify-buffer' is run."
57 (with-temp-buffer 57 (with-temp-buffer
58 (setq-local buffer-file-coding-system 'utf-8)
58 (dolist (mode modes) 59 (dolist (mode modes)
59 (erase-buffer) 60 (erase-buffer)
60 (funcall mode) 61 (funcall mode)
@@ -187,6 +188,7 @@ The function must terminate as soon as callback returns nil."
187 188
188(defun tildify-space-test--test (modes nbsp env-open &optional set-space-string) 189(defun tildify-space-test--test (modes nbsp env-open &optional set-space-string)
189 (with-temp-buffer 190 (with-temp-buffer
191 (setq-local buffer-file-coding-system 'utf-8)
190 (dolist (mode modes) 192 (dolist (mode modes)
191 (funcall mode) 193 (funcall mode)
192 (when set-space-string 194 (when set-space-string
@@ -226,6 +228,7 @@ The function must terminate as soon as callback returns nil."
226(defun tildify-space-undo-test--test 228(defun tildify-space-undo-test--test
227 (modes nbsp env-open &optional set-space-string) 229 (modes nbsp env-open &optional set-space-string)
228 (with-temp-buffer 230 (with-temp-buffer
231 (setq-local buffer-file-coding-system 'utf-8)
229 (dolist (mode modes) 232 (dolist (mode modes)
230 (funcall mode) 233 (funcall mode)
231 (when set-space-string 234 (when set-space-string