From: João Távora Date: Mon, 24 Dec 2018 12:36:10 +0000 (+0000) Subject: Correctly implement two electric.el tests X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3e38509f9ae7c3e9a20c02fb40ab423028e60b3f;p=emacs.git 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. --- diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 71ff73b3f8a..d40d942dab8 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