diff options
| author | Juanma Barranquero | 2015-11-13 14:09:35 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2015-11-13 14:09:35 +0100 |
| commit | a731c2f163071ed6efe7d93fa9585dd66ddf2fbb (patch) | |
| tree | 2e8b8c91ef1023d15105b5819d9ec1adbef3a66d | |
| parent | 2b4c0c0cefa4a70b4b8a3a8f0fa1e13416f7415f (diff) | |
| download | emacs-a731c2f163071ed6efe7d93fa9585dd66ddf2fbb.tar.gz emacs-a731c2f163071ed6efe7d93fa9585dd66ddf2fbb.zip | |
* test/automated/simple-test.el: Add test for bug#20698 (bug#21885)
(simple-test--transpositions): New macro.
(simple-transpose-subr): New test.
| -rw-r--r-- | test/automated/simple-test.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/automated/simple-test.el b/test/automated/simple-test.el index 86c9fc2e767..07b5eaa93e4 100644 --- a/test/automated/simple-test.el +++ b/test/automated/simple-test.el | |||
| @@ -34,6 +34,17 @@ | |||
| 34 | (buffer-substring (point) (point-max))))) | 34 | (buffer-substring (point) (point-max))))) |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | (defmacro simple-test--transpositions (&rest body) | ||
| 38 | (declare (indent 0) | ||
| 39 | (debug t)) | ||
| 40 | `(with-temp-buffer | ||
| 41 | (emacs-lisp-mode) | ||
| 42 | (insert "(s1) (s2) (s3) (s4) (s5)") | ||
| 43 | (backward-sexp 1) | ||
| 44 | ,@body | ||
| 45 | (cons (buffer-substring (point-min) (point)) | ||
| 46 | (buffer-substring (point) (point-max))))) | ||
| 47 | |||
| 37 | 48 | ||
| 38 | ;;; `newline' | 49 | ;;; `newline' |
| 39 | (ert-deftest newline () | 50 | (ert-deftest newline () |
| @@ -233,6 +244,12 @@ | |||
| 233 | (car buffer-undo-list) | 244 | (car buffer-undo-list) |
| 234 | (undo-auto--boundaries 'test)))) | 245 | (undo-auto--boundaries 'test)))) |
| 235 | 246 | ||
| 247 | ;;; Transposition with negative args (bug#20698, bug#21885) | ||
| 248 | (ert-deftest simple-transpose-subr () | ||
| 249 | (should (equal (simple-test--transpositions (transpose-sexps -1)) | ||
| 250 | '("(s1) (s2) (s4)" . " (s3) (s5)"))) | ||
| 251 | (should (equal (simple-test--transpositions (transpose-sexps -2)) | ||
| 252 | '("(s1) (s4)" . " (s2) (s3) (s5)")))) | ||
| 236 | 253 | ||
| 237 | 254 | ||
| 238 | (provide 'simple-test) | 255 | (provide 'simple-test) |