emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/fix-33794-extend-electric-layout-mode 3e38509 2/2:


From: João Távora
Subject: [Emacs-diffs] scratch/fix-33794-extend-electric-layout-mode 3e38509 2/2: Correctly implement two electric.el tests
Date: Mon, 24 Dec 2018 07:43:08 -0500 (EST)

branch: scratch/fix-33794-extend-electric-layout-mode
commit 3e38509f9ae7c3e9a20c02fb40ab423028e60b3f
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Correctly implement two electric.el tests
    
    * test/lisp/electric-tests.el (electric-pair-mode-newline-between-parens)
    (electric-layout-mode-newline-between-parens-without-e-p-m):
    Correctly code these two tests.
---
 test/lisp/electric-tests.el | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 71ff73b..d40d942 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -863,23 +863,18 @@ baz\"\""
       (call-interactively (key-binding `[,last-command-event])))
     (should (equal (buffer-string) "int main ()\n{\n  \n}"))))
 
-;; FIXME: The two following tests fail, because the newline simulation
-;; fails to indent the new line.  Interactively, they work fine.
-;; Don't know why...
 (ert-deftest electric-pair-mode-newline-between-parens ()
-  :expected-result :failed
   (ert-with-test-buffer (:name "electric-pair-mode-newline-between-parens")
     (plainer-c-mode)
     (electric-layout-local-mode -1) ;; ensure e-l-m mode is off
     (electric-pair-local-mode 1)
     (insert-before-markers "int main () {}")
     (backward-char 1)
-    (let ((last-command-event ?\n))
+    (let ((last-command-event ?
))
       (call-interactively (key-binding `[,last-command-event])))
-    (should (equal (buffer-string) "int main ()\n{\n  \n}"))))
+    (should (equal (buffer-string) "int main () {\n  \n}"))))
 
 (ert-deftest electric-layout-mode-newline-between-parens-without-e-p-m ()
-  :expected-result :failed
   (ert-with-test-buffer (:name "electric-pair-mode-newline-between-parens")
     (plainer-c-mode)
     (electric-layout-local-mode 1)
@@ -896,9 +891,9 @@ baz\"\""
                        '(after-stay))))))
     (insert "int main () {}")
     (backward-char 1)
-    (let ((last-command-event ?\n))
+    (let ((last-command-event ?
))
       (call-interactively (key-binding `[,last-command-event])))
-    (should (equal (buffer-string) "int main ()\n{\n  \n}"))))
+    (should (equal (buffer-string) "int main () {\n  \n}"))))
 
 (provide 'electric-tests)
 ;;; electric-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]