diff options
| author | Stephen Leake | 2019-09-18 17:43:28 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-09-18 17:43:28 -0700 |
| commit | 34f1035e878a06ad181ff7fc533cd1fa0a565847 (patch) | |
| tree | 7708b0e62b09571ba5b2c625d810cd932c380508 /test/lisp | |
| parent | b478444099655f36f7b243e21e8f98051299ca8f (diff) | |
| parent | 107ce3050fc37b9a13d8304ae1bb73fac9de5f61 (diff) | |
| download | emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.tar.gz emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.zip | |
Merge commit '107ce3050fc37b9a13d8304ae1bb73fac9de5f61'
Diffstat (limited to 'test/lisp')
| -rw-r--r-- | test/lisp/emacs-lisp/backquote-tests.el | 47 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/backtrace-tests.el | 49 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-print-tests.el | 115 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 21 | ||||
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 13 | ||||
| -rw-r--r-- | test/lisp/replace-tests.el | 18 | ||||
| -rw-r--r-- | test/lisp/shadowfile-tests.el | 13 |
7 files changed, 145 insertions, 131 deletions
diff --git a/test/lisp/emacs-lisp/backquote-tests.el b/test/lisp/emacs-lisp/backquote-tests.el new file mode 100644 index 00000000000..01f2c4a897e --- /dev/null +++ b/test/lisp/emacs-lisp/backquote-tests.el | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | ;;; backquote-tests.el --- Tests for backquote.el -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2019 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'ert) | ||
| 25 | |||
| 26 | (ert-deftest backquote-test-basic () | ||
| 27 | (let ((lst '(ba bb bc)) | ||
| 28 | (vec [ba bb bc])) | ||
| 29 | (should (equal 3 `,(eval '(+ x y) '((x . 1) (y . 2))))) | ||
| 30 | (should (equal vec `[,@lst])) | ||
| 31 | (should (equal `(a lst c) '(a lst c))) | ||
| 32 | (should (equal `(a ,lst c) '(a (ba bb bc) c))) | ||
| 33 | (should (equal `(a ,@lst c) '(a ba bb bc c))) | ||
| 34 | ;; Vectors work just like lists. | ||
| 35 | (should (equal `(a vec c) '(a vec c))) | ||
| 36 | (should (equal `(a ,vec c) '(a [ba bb bc] c))) | ||
| 37 | (should (equal `(a ,@vec c) '(a ba bb bc c))))) | ||
| 38 | |||
| 39 | (ert-deftest backquote-test-nested () | ||
| 40 | "Test nested backquotes." | ||
| 41 | (let ((lst '(ba bb bc)) | ||
| 42 | (vec [ba bb bc])) | ||
| 43 | (should (equal `(a ,`(,@lst) c) `(a ,lst c))) | ||
| 44 | (should (equal `(a ,`[,@lst] c) `(a ,vec c))) | ||
| 45 | (should (equal `(a ,@`[,@lst] c) `(a ,@lst c))))) | ||
| 46 | |||
| 47 | ;;; backquote-tests.el ends here | ||
diff --git a/test/lisp/emacs-lisp/backtrace-tests.el b/test/lisp/emacs-lisp/backtrace-tests.el index ce827e0166f..be154953423 100644 --- a/test/lisp/emacs-lisp/backtrace-tests.el +++ b/test/lisp/emacs-lisp/backtrace-tests.el | |||
| @@ -335,6 +335,55 @@ line contains the strings \"lambda\" and \"number\"." | |||
| 335 | (should (string-match-p results | 335 | (should (string-match-p results |
| 336 | (backtrace-tests--get-substring (point-min) (point-max))))))) | 336 | (backtrace-tests--get-substring (point-min) (point-max))))))) |
| 337 | 337 | ||
| 338 | (ert-deftest backtrace-tests--print-gensym () | ||
| 339 | "Backtrace buffers can toggle `print-gensym' syntax." | ||
| 340 | (ert-with-test-buffer (:name "print-gensym") | ||
| 341 | (let* ((print-gensym nil) | ||
| 342 | (arg (list (gensym "first") (gensym) (gensym "last"))) | ||
| 343 | (results (backtrace-tests--make-regexp | ||
| 344 | (backtrace-tests--result arg))) | ||
| 345 | (results-gensym (regexp-quote (let ((print-gensym t)) | ||
| 346 | (backtrace-tests--result arg)))) | ||
| 347 | (last-frame (backtrace-tests--make-regexp | ||
| 348 | (format (nth (1- backtrace-tests--line-count) | ||
| 349 | (backtrace-tests--backtrace-lines)) | ||
| 350 | arg))) | ||
| 351 | (last-frame-gensym (regexp-quote | ||
| 352 | (let ((print-gensym t)) | ||
| 353 | (format (nth (1- backtrace-tests--line-count) | ||
| 354 | (backtrace-tests--backtrace-lines)) | ||
| 355 | arg))))) | ||
| 356 | (backtrace-tests--make-backtrace arg) | ||
| 357 | (backtrace-print) | ||
| 358 | (should (string-match-p results | ||
| 359 | (backtrace-tests--get-substring (point-min) (point-max)))) | ||
| 360 | ;; Go to the last frame. | ||
| 361 | (goto-char (point-max)) | ||
| 362 | (forward-line -1) | ||
| 363 | ;; Turn on print-gensym for that frame. | ||
| 364 | (backtrace-toggle-print-gensym) | ||
| 365 | (should (string-match-p last-frame-gensym | ||
| 366 | (backtrace-tests--get-substring (point) (point-max)))) | ||
| 367 | ;; Turn off print-gensym for the frame. | ||
| 368 | (backtrace-toggle-print-gensym) | ||
| 369 | (should (string-match-p last-frame | ||
| 370 | (backtrace-tests--get-substring (point) (point-max)))) | ||
| 371 | (should (string-match-p results | ||
| 372 | (backtrace-tests--get-substring (point-min) (point-max)))) | ||
| 373 | ;; Turn print-gensym on for the buffer. | ||
| 374 | (backtrace-toggle-print-gensym '(4)) | ||
| 375 | (should (string-match-p last-frame-gensym | ||
| 376 | (backtrace-tests--get-substring (point) (point-max)))) | ||
| 377 | (should (string-match-p results-gensym | ||
| 378 | (backtrace-tests--get-substring (point-min) (point-max)))) | ||
| 379 | ;; Turn print-gensym off. | ||
| 380 | (backtrace-toggle-print-gensym '(4)) | ||
| 381 | (should (string-match-p last-frame | ||
| 382 | (backtrace-tests--get-substring | ||
| 383 | (point) (+ (point) (length last-frame))))) | ||
| 384 | (should (string-match-p results | ||
| 385 | (backtrace-tests--get-substring (point-min) (point-max))))))) | ||
| 386 | |||
| 338 | (defun backtrace-tests--make-regexp (str) | 387 | (defun backtrace-tests--make-regexp (str) |
| 339 | "Make regexp from STR for `backtrace-tests--print-circle'. | 388 | "Make regexp from STR for `backtrace-tests--print-circle'. |
| 340 | Used for results of printing circular objects without | 389 | Used for results of printing circular objects without |
diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/cl-print-tests.el index 406c528dce5..31d79df71b5 100644 --- a/test/lisp/emacs-lisp/cl-print-tests.el +++ b/test/lisp/emacs-lisp/cl-print-tests.el | |||
| @@ -19,109 +19,17 @@ | |||
| 19 | 19 | ||
| 20 | ;;; Commentary: | 20 | ;;; Commentary: |
| 21 | 21 | ||
| 22 | ;; See test/src/print-tests.el for tests which apply to both | ||
| 23 | ;; cl-print.el and src/print.c. | ||
| 24 | |||
| 22 | ;;; Code: | 25 | ;;; Code: |
| 23 | 26 | ||
| 24 | (require 'ert) | 27 | (require 'ert) |
| 25 | 28 | ||
| 26 | (cl-defstruct cl-print--test a b) | ||
| 27 | |||
| 28 | (ert-deftest cl-print-tests-1 () | ||
| 29 | "Test cl-print code." | ||
| 30 | (let ((x (make-cl-print--test :a 1 :b 2))) | ||
| 31 | (let ((print-circle nil)) | ||
| 32 | (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x))) | ||
| 33 | "((x . #s(cl-print--test :a 1 :b 2)) (y . #s(cl-print--test :a 1 :b 2)))"))) | ||
| 34 | (let ((print-circle t)) | ||
| 35 | (should (equal (cl-prin1-to-string `((x . ,x) (y . ,x))) | ||
| 36 | "((x . #1=#s(cl-print--test :a 1 :b 2)) (y . #1#))"))) | ||
| 37 | (should (string-match "\\`#f(compiled-function (x) \"[^\"]+\" [^)]*)\\'" | ||
| 38 | (cl-prin1-to-string (symbol-function #'caar)))))) | ||
| 39 | |||
| 40 | (ert-deftest cl-print-tests-2 () | ||
| 41 | (let ((x (record 'foo 1 2 3))) | ||
| 42 | (should (equal | ||
| 43 | x | ||
| 44 | (car (read-from-string (with-output-to-string (prin1 x)))))) | ||
| 45 | (let ((print-circle t)) | ||
| 46 | (should (string-match | ||
| 47 | "\\`(#1=#s(foo 1 2 3) #1#)\\'" | ||
| 48 | (cl-prin1-to-string (list x x))))))) | ||
| 49 | |||
| 50 | (cl-defstruct (cl-print-tests-struct | 29 | (cl-defstruct (cl-print-tests-struct |
| 51 | (:constructor cl-print-tests-con)) | 30 | (:constructor cl-print-tests-con)) |
| 52 | a b c d e) | 31 | a b c d e) |
| 53 | 32 | ||
| 54 | (ert-deftest cl-print-tests-3 () | ||
| 55 | "CL printing observes `print-length'." | ||
| 56 | (let ((long-list (make-list 5 'a)) | ||
| 57 | (long-vec (make-vector 5 'b)) | ||
| 58 | (long-struct (cl-print-tests-con)) | ||
| 59 | (long-string (make-string 5 ?a)) | ||
| 60 | (print-length 4)) | ||
| 61 | (should (equal "(a a a a ...)" (cl-prin1-to-string long-list))) | ||
| 62 | (should (equal "[b b b b ...]" (cl-prin1-to-string long-vec))) | ||
| 63 | (should (equal "#s(cl-print-tests-struct :a nil :b nil :c nil :d nil ...)" | ||
| 64 | (cl-prin1-to-string long-struct))) | ||
| 65 | (should (equal "\"aaaa...\"" (cl-prin1-to-string long-string))))) | ||
| 66 | |||
| 67 | (ert-deftest cl-print-tests-4 () | ||
| 68 | "CL printing observes `print-level'." | ||
| 69 | (let* ((deep-list '(a (b (c (d (e)))))) | ||
| 70 | (buried-vector '(a (b (c (d [e]))))) | ||
| 71 | (deep-struct (cl-print-tests-con)) | ||
| 72 | (buried-struct `(a (b (c (d ,deep-struct))))) | ||
| 73 | (buried-string '(a (b (c (d #("hello" 0 5 (cl-print-test t))))))) | ||
| 74 | (buried-simple-string '(a (b (c (d "hello"))))) | ||
| 75 | (print-level 4)) | ||
| 76 | (setf (cl-print-tests-struct-a deep-struct) deep-list) | ||
| 77 | (should (equal "(a (b (c (d ...))))" (cl-prin1-to-string deep-list))) | ||
| 78 | (should (equal "(a (b (c (d ...))))" (cl-prin1-to-string buried-vector))) | ||
| 79 | (should (equal "(a (b (c (d ...))))" (cl-prin1-to-string buried-struct))) | ||
| 80 | (should (equal "(a (b (c (d ...))))" (cl-prin1-to-string buried-string))) | ||
| 81 | (should (equal "(a (b (c (d \"hello\"))))" | ||
| 82 | (cl-prin1-to-string buried-simple-string))) | ||
| 83 | (should (equal "#s(cl-print-tests-struct :a (a (b (c ...))) :b nil :c nil :d nil :e nil)" | ||
| 84 | (cl-prin1-to-string deep-struct))))) | ||
| 85 | |||
| 86 | (ert-deftest cl-print-tests-5 () | ||
| 87 | "CL printing observes `print-quoted'." | ||
| 88 | (let ((quoted-stuff '('a #'b `(,c ,@d)))) | ||
| 89 | (let ((print-quoted t)) | ||
| 90 | (should (equal "('a #'b `(,c ,@d))" | ||
| 91 | (cl-prin1-to-string quoted-stuff)))) | ||
| 92 | (let ((print-quoted nil)) | ||
| 93 | (should (equal "((quote a) (function b) (\\` ((\\, c) (\\,@ d))))" | ||
| 94 | (cl-prin1-to-string quoted-stuff)))))) | ||
| 95 | |||
| 96 | (ert-deftest cl-print-tests-strings () | ||
| 97 | "CL printing prints strings and propertized strings." | ||
| 98 | (let* ((str1 "abcdefghij") | ||
| 99 | (str2 #("abcdefghij" 3 6 (bold t) 7 9 (italic t))) | ||
| 100 | (str3 #("abcdefghij" 0 10 (test t))) | ||
| 101 | (obj '(a b)) | ||
| 102 | ;; Since the byte compiler reuses string literals, | ||
| 103 | ;; and the put-text-property call is destructive, use | ||
| 104 | ;; copy-sequence to make a new string. | ||
| 105 | (str4 (copy-sequence "abcdefghij"))) | ||
| 106 | (put-text-property 0 5 'test obj str4) | ||
| 107 | (put-text-property 7 10 'test obj str4) | ||
| 108 | |||
| 109 | (should (equal "\"abcdefghij\"" (cl-prin1-to-string str1))) | ||
| 110 | (should (equal "#(\"abcdefghij\" 3 6 (bold t) 7 9 (italic t))" | ||
| 111 | (cl-prin1-to-string str2))) | ||
| 112 | (should (equal "#(\"abcdefghij\" 0 10 (test t))" | ||
| 113 | (cl-prin1-to-string str3))) | ||
| 114 | (let ((print-circle nil)) | ||
| 115 | (should | ||
| 116 | (equal | ||
| 117 | "#(\"abcdefghij\" 0 5 (test (a b)) 7 10 (test (a b)))" | ||
| 118 | (cl-prin1-to-string str4)))) | ||
| 119 | (let ((print-circle t)) | ||
| 120 | (should | ||
| 121 | (equal | ||
| 122 | "#(\"abcdefghij\" 0 5 (test #1=(a b)) 7 10 (test #1#))" | ||
| 123 | (cl-prin1-to-string str4)))))) | ||
| 124 | |||
| 125 | (ert-deftest cl-print-tests-ellipsis-cons () | 33 | (ert-deftest cl-print-tests-ellipsis-cons () |
| 126 | "Ellipsis expansion works in conses." | 34 | "Ellipsis expansion works in conses." |
| 127 | (let ((print-length 4) | 35 | (let ((print-length 4) |
| @@ -216,23 +124,6 @@ | |||
| 216 | (should (string-match expanded (with-output-to-string | 124 | (should (string-match expanded (with-output-to-string |
| 217 | (cl-print-expand-ellipsis value nil)))))) | 125 | (cl-print-expand-ellipsis value nil)))))) |
| 218 | 126 | ||
| 219 | (ert-deftest cl-print-circle () | ||
| 220 | (let ((x '(#1=(a . #1#) #1#))) | ||
| 221 | (let ((print-circle nil)) | ||
| 222 | (should (string-match "\\`((a . #[0-9]) (a . #[0-9]))\\'" | ||
| 223 | (cl-prin1-to-string x)))) | ||
| 224 | (let ((print-circle t)) | ||
| 225 | (should (equal "(#1=(a . #1#) #1#)" (cl-prin1-to-string x)))))) | ||
| 226 | |||
| 227 | (ert-deftest cl-print-circle-2 () | ||
| 228 | ;; Bug#31146. | ||
| 229 | (let ((x '(0 . #1=(0 . #1#)))) | ||
| 230 | (let ((print-circle nil)) | ||
| 231 | (should (string-match "\\`(0 0 . #[0-9])\\'" | ||
| 232 | (cl-prin1-to-string x)))) | ||
| 233 | (let ((print-circle t)) | ||
| 234 | (should (equal "(0 . #1=(0 . #1#))" (cl-prin1-to-string x)))))) | ||
| 235 | |||
| 236 | (ert-deftest cl-print-tests-print-to-string-with-limit () | 127 | (ert-deftest cl-print-tests-print-to-string-with-limit () |
| 237 | (let* ((thing10 (make-list 10 'a)) | 128 | (let* ((thing10 (make-list 10 'a)) |
| 238 | (thing100 (make-list 100 'a)) | 129 | (thing100 (make-list 100 'a)) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index dd6b9edd000..d7e0a045106 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2412,9 +2412,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2412 | (unwind-protect | 2412 | (unwind-protect |
| 2413 | ;; FIXME: This fails on my QNAP server, see | 2413 | ;; FIXME: This fails on my QNAP server, see |
| 2414 | ;; /share/Web/owncloud/data/owncloud.log | 2414 | ;; /share/Web/owncloud/data/owncloud.log |
| 2415 | (unless (and (tramp--test-nextcloud-p) | 2415 | (unless (tramp--test-nextcloud-p) |
| 2416 | (or (not (file-remote-p source)) | ||
| 2417 | (not (file-remote-p target)))) | ||
| 2418 | (make-directory source) | 2416 | (make-directory source) |
| 2419 | (should (file-directory-p source)) | 2417 | (should (file-directory-p source)) |
| 2420 | (write-region "foo" nil (expand-file-name "foo" source)) | 2418 | (write-region "foo" nil (expand-file-name "foo" source)) |
| @@ -2437,8 +2435,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2437 | (unwind-protect | 2435 | (unwind-protect |
| 2438 | ;; FIXME: This fails on my QNAP server, see | 2436 | ;; FIXME: This fails on my QNAP server, see |
| 2439 | ;; /share/Web/owncloud/data/owncloud.log | 2437 | ;; /share/Web/owncloud/data/owncloud.log |
| 2440 | (unless | 2438 | (unless (tramp--test-nextcloud-p) |
| 2441 | (and (tramp--test-nextcloud-p) (not (file-remote-p source))) | ||
| 2442 | (make-directory source) | 2439 | (make-directory source) |
| 2443 | (should (file-directory-p source)) | 2440 | (should (file-directory-p source)) |
| 2444 | (write-region "foo" nil (expand-file-name "foo" source)) | 2441 | (write-region "foo" nil (expand-file-name "foo" source)) |
| @@ -4407,7 +4404,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4407 | "foo" | 4404 | "foo" |
| 4408 | (funcall | 4405 | (funcall |
| 4409 | this-shell-command-to-string | 4406 | this-shell-command-to-string |
| 4410 | (format "echo -n ${%s:?bla}" envvar)))))) | 4407 | (format "echo -n ${%s:-bla}" envvar)))))) |
| 4411 | 4408 | ||
| 4412 | (unwind-protect | 4409 | (unwind-protect |
| 4413 | ;; Set the empty value. | 4410 | ;; Set the empty value. |
| @@ -4419,7 +4416,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4419 | "bla" | 4416 | "bla" |
| 4420 | (funcall | 4417 | (funcall |
| 4421 | this-shell-command-to-string | 4418 | this-shell-command-to-string |
| 4422 | (format "echo -n ${%s:?bla}" envvar)))) | 4419 | (format "echo -n ${%s:-bla}" envvar)))) |
| 4423 | ;; Variable is set. | 4420 | ;; Variable is set. |
| 4424 | (should | 4421 | (should |
| 4425 | (string-match | 4422 | (string-match |
| @@ -4441,7 +4438,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4441 | "foo" | 4438 | "foo" |
| 4442 | (funcall | 4439 | (funcall |
| 4443 | this-shell-command-to-string | 4440 | this-shell-command-to-string |
| 4444 | (format "echo -n ${%s:?bla}" envvar)))) | 4441 | (format "echo -n ${%s:-bla}" envvar)))) |
| 4445 | (let ((process-environment | 4442 | (let ((process-environment |
| 4446 | (cons envvar process-environment))) | 4443 | (cons envvar process-environment))) |
| 4447 | ;; Variable is unset. | 4444 | ;; Variable is unset. |
| @@ -4450,12 +4447,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4450 | "bla" | 4447 | "bla" |
| 4451 | (funcall | 4448 | (funcall |
| 4452 | this-shell-command-to-string | 4449 | this-shell-command-to-string |
| 4453 | (format "echo -n ${%s:?bla}" envvar)))) | 4450 | (format "echo -n ${%s:-bla}" envvar)))) |
| 4454 | ;; Variable is unset. | 4451 | ;; Variable is unset. |
| 4455 | (should-not | 4452 | (should-not |
| 4456 | (string-match | 4453 | (string-match |
| 4457 | (regexp-quote envvar) | 4454 | (regexp-quote envvar) |
| 4458 | (funcall this-shell-command-to-string "env"))))))))) | 4455 | ;; We must remove PS1, the output is truncated otherwise. |
| 4456 | (funcall | ||
| 4457 | this-shell-command-to-string "printenv | grep -v PS1"))))))))) | ||
| 4459 | 4458 | ||
| 4460 | ;; This test is inspired by Bug#27009. | 4459 | ;; This test is inspired by Bug#27009. |
| 4461 | (ert-deftest tramp-test33-environment-variables-and-port-numbers () | 4460 | (ert-deftest tramp-test33-environment-variables-and-port-numbers () |
| @@ -5303,7 +5302,7 @@ This requires restrictions of file name syntax." | |||
| 5303 | ;; of process output. So we unset it temporarily. | 5302 | ;; of process output. So we unset it temporarily. |
| 5304 | (setenv "PS1") | 5303 | (setenv "PS1") |
| 5305 | (with-temp-buffer | 5304 | (with-temp-buffer |
| 5306 | (should (zerop (process-file "env" nil t nil))) | 5305 | (should (zerop (process-file "printenv" nil t nil))) |
| 5307 | (goto-char (point-min)) | 5306 | (goto-char (point-min)) |
| 5308 | (should | 5307 | (should |
| 5309 | (re-search-forward | 5308 | (re-search-forward |
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index b1cf7e8806a..c5ad1dfb862 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -1351,7 +1351,7 @@ this is an arbitrarily | |||
| 1351 | expected))))) | 1351 | expected))))) |
| 1352 | 1352 | ||
| 1353 | 1353 | ||
| 1354 | ;;; Autofill | 1354 | ;;; Filling |
| 1355 | 1355 | ||
| 1356 | (ert-deftest python-auto-fill-docstring () | 1356 | (ert-deftest python-auto-fill-docstring () |
| 1357 | (python-tests-with-temp-buffer | 1357 | (python-tests-with-temp-buffer |
| @@ -1368,6 +1368,17 @@ def some_function(arg1, | |||
| 1368 | (forward-line 1) | 1368 | (forward-line 1) |
| 1369 | (should (= docindent (current-indentation)))))) | 1369 | (should (= docindent (current-indentation)))))) |
| 1370 | 1370 | ||
| 1371 | (ert-deftest python-fill-docstring () | ||
| 1372 | (python-tests-with-temp-buffer | ||
| 1373 | "\ | ||
| 1374 | r'''aaa | ||
| 1375 | |||
| 1376 | this is a test this is a test this is a test this is a test this is a test this is a test. | ||
| 1377 | '''" | ||
| 1378 | (search-forward "test.") | ||
| 1379 | (fill-paragraph) | ||
| 1380 | (should (= (current-indentation) 0)))) | ||
| 1381 | |||
| 1371 | 1382 | ||
| 1372 | ;;; Mark | 1383 | ;;; Mark |
| 1373 | 1384 | ||
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index f7bf2d93658..f42d47c2bfb 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el | |||
| @@ -514,7 +514,9 @@ Return the last evalled form in BODY." | |||
| 514 | (should | 514 | (should |
| 515 | (replace-tests-with-undo | 515 | (replace-tests-with-undo |
| 516 | input "theorem \\([0-9]+\\)" | 516 | input "theorem \\([0-9]+\\)" |
| 517 | "theorem \\\\ref{theo_\\1}" | 517 | '(replace-eval-replacement |
| 518 | replace-quote | ||
| 519 | (format "theorem \\\\ref{theo_%d}" (1+ (string-to-number (match-string 1))))) | ||
| 518 | ((?\s . (1 2)) (?U . (3))) | 520 | ((?\s . (1 2)) (?U . (3))) |
| 519 | ?q | 521 | ?q |
| 520 | (string= input (buffer-string))))) | 522 | (string= input (buffer-string))))) |
| @@ -530,4 +532,18 @@ Return the last evalled form in BODY." | |||
| 530 | ?q | 532 | ?q |
| 531 | (string= expected (buffer-string)))))) | 533 | (string= expected (buffer-string)))))) |
| 532 | 534 | ||
| 535 | (ert-deftest query-replace-undo-bug37287 () | ||
| 536 | "Test for https://debbugs.gnu.org/37287 ." | ||
| 537 | (let ((input "foo-1\nfoo-2\nfoo-3") | ||
| 538 | (expected "foo-2\nfoo-2\nfoo-3")) | ||
| 539 | (should | ||
| 540 | (replace-tests-with-undo | ||
| 541 | input "\\([0-9]\\)" | ||
| 542 | '(replace-eval-replacement | ||
| 543 | replace-quote | ||
| 544 | (format "%d" (1+ (string-to-number (match-string 1))))) | ||
| 545 | ((?\s . (1 2 4)) (?U . (3))) | ||
| 546 | ?q | ||
| 547 | (string= expected (buffer-string)))))) | ||
| 548 | |||
| 533 | ;;; replace-tests.el ends here | 549 | ;;; replace-tests.el ends here |
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index a93664f6536..7caddc53d75 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el | |||
| @@ -64,9 +64,14 @@ | |||
| 64 | "Temporary directory for Tramp tests.") | 64 | "Temporary directory for Tramp tests.") |
| 65 | 65 | ||
| 66 | (setq password-cache-expiry nil | 66 | (setq password-cache-expiry nil |
| 67 | shadow-debug t | 67 | shadow-debug nil |
| 68 | tramp-verbose 0 | 68 | tramp-verbose 0 |
| 69 | tramp-message-show-message nil) | 69 | tramp-message-show-message nil |
| 70 | ;; On macOS, `temporary-file-directory' is a symlinked directory. | ||
| 71 | temporary-file-directory (file-truename temporary-file-directory) | ||
| 72 | shadow-test-remote-temporary-file-directory | ||
| 73 | (ignore-errors | ||
| 74 | (file-truename shadow-test-remote-temporary-file-directory))) | ||
| 70 | 75 | ||
| 71 | ;; This should happen on hydra only. | 76 | ;; This should happen on hydra only. |
| 72 | (when (getenv "EMACS_HYDRA_CI") | 77 | (when (getenv "EMACS_HYDRA_CI") |
| @@ -718,8 +723,6 @@ guaranteed by the originator of a cluster definition." | |||
| 718 | (shadow-info-file shadow-test-info-file) | 723 | (shadow-info-file shadow-test-info-file) |
| 719 | (shadow-todo-file shadow-test-todo-file) | 724 | (shadow-todo-file shadow-test-todo-file) |
| 720 | (shadow-inhibit-message t) | 725 | (shadow-inhibit-message t) |
| 721 | (shadow-test-remote-temporary-file-directory | ||
| 722 | (file-truename shadow-test-remote-temporary-file-directory)) | ||
| 723 | shadow-clusters shadow-literal-groups shadow-regexp-groups | 726 | shadow-clusters shadow-literal-groups shadow-regexp-groups |
| 724 | shadow-files-to-copy | 727 | shadow-files-to-copy |
| 725 | cluster1 cluster2 primary regexp file) | 728 | cluster1 cluster2 primary regexp file) |
| @@ -858,8 +861,6 @@ guaranteed by the originator of a cluster definition." | |||
| 858 | (shadow-info-file shadow-test-info-file) | 861 | (shadow-info-file shadow-test-info-file) |
| 859 | (shadow-todo-file shadow-test-todo-file) | 862 | (shadow-todo-file shadow-test-todo-file) |
| 860 | (shadow-inhibit-message t) | 863 | (shadow-inhibit-message t) |
| 861 | (shadow-test-remote-temporary-file-directory | ||
| 862 | (file-truename shadow-test-remote-temporary-file-directory)) | ||
| 863 | (shadow-noquery t) | 864 | (shadow-noquery t) |
| 864 | shadow-clusters shadow-files-to-copy | 865 | shadow-clusters shadow-files-to-copy |
| 865 | cluster1 cluster2 primary regexp file mocked-input) | 866 | cluster1 cluster2 primary regexp file mocked-input) |