[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a731c2f: * test/automated/simple-test.el: Add test
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] master a731c2f: * test/automated/simple-test.el: Add test for bug#20698 (bug#21885) |
Date: |
Fri, 13 Nov 2015 13:11:46 +0000 |
branch: master
commit a731c2f163071ed6efe7d93fa9585dd66ddf2fbb
Author: Juanma Barranquero <address@hidden>
Commit: Juanma Barranquero <address@hidden>
* test/automated/simple-test.el: Add test for bug#20698 (bug#21885)
(simple-test--transpositions): New macro.
(simple-transpose-subr): New test.
---
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 86c9fc2..07b5eaa 100644
--- a/test/automated/simple-test.el
+++ b/test/automated/simple-test.el
@@ -34,6 +34,17 @@
(buffer-substring (point) (point-max)))))
+(defmacro simple-test--transpositions (&rest body)
+ (declare (indent 0)
+ (debug t))
+ `(with-temp-buffer
+ (emacs-lisp-mode)
+ (insert "(s1) (s2) (s3) (s4) (s5)")
+ (backward-sexp 1)
+ ,@body
+ (cons (buffer-substring (point-min) (point))
+ (buffer-substring (point) (point-max)))))
+
;;; `newline'
(ert-deftest newline ()
@@ -233,6 +244,12 @@
(car buffer-undo-list)
(undo-auto--boundaries 'test))))
+;;; Transposition with negative args (bug#20698, bug#21885)
+(ert-deftest simple-transpose-subr ()
+ (should (equal (simple-test--transpositions (transpose-sexps -1))
+ '("(s1) (s2) (s4)" . " (s3) (s5)")))
+ (should (equal (simple-test--transpositions (transpose-sexps -2))
+ '("(s1) (s4)" . " (s2) (s3) (s5)"))))
(provide 'simple-test)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master a731c2f: * test/automated/simple-test.el: Add test for bug#20698 (bug#21885),
Juanma Barranquero <=