From 54f297904e0c641fcfd81f16e9a87177124a27be Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Thu, 17 Jan 2019 12:51:40 +0000 Subject: [PATCH] Temporarily comment out CC Mode from tests which are incompatible with it. * tests/electric-tests (electric-pair-test-for): comment out c++-mode from the list of modes to be used in tests. (electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings) (ert-deftest electric-layout-int-main-kernel-style) (ert-deftest electric-layout-int-main-allman-style): Comment out. --- test/lisp/electric-tests.el | 64 ++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 5a4b20ed04e..86d0daa605a 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -157,7 +157,8 @@ The buffer's contents should %s: expected-string expected-point bindings - (modes '(quote (ruby-mode c++-mode))) + (modes '(quote (ruby-mode ;; c++-mode + ))) (test-in-comments t) (test-in-strings t) (test-in-code t) @@ -396,10 +397,10 @@ baz\"\"" ;; mode will sort this out eventually, using some new e-p-m machinery. ;; See ;; https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00535.html -(setf - (ert-test-expected-result-type - (ert-get-test 'electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings)) - :failed) +;; (setf +;; (ert-test-expected-result-type +;; (ert-get-test 'electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings)) +;; :failed) (define-electric-pair-test whitespace-chomping-dont-cross-comments " ( \n\t\t\n ) " "--)------" :expected-string " () \n\t\t\n ) " @@ -815,31 +816,34 @@ baz\"\"" ;;; tests for `electric-layout-mode' -(ert-deftest electric-layout-int-main-kernel-style () - (ert-with-test-buffer () - (c-mode) - (electric-layout-local-mode 1) - (electric-pair-local-mode 1) - (electric-indent-local-mode 1) - (setq-local electric-layout-rules - '((?\{ . (after-stay after)))) - (insert "int main () ") - (let ((last-command-event ?\{)) - (call-interactively (key-binding `[,last-command-event]))) - (should (equal (buffer-string) "int main () {\n \n}")))) - -(ert-deftest electric-layout-int-main-allman-style () - (ert-with-test-buffer () - (c-mode) - (electric-layout-local-mode 1) - (electric-pair-local-mode 1) - (electric-indent-local-mode 1) - (setq-local electric-layout-rules - '((?\{ . (before after-stay after)))) - (insert "int main () ") - (let ((last-command-event ?\{)) - (call-interactively (key-binding `[,last-command-event]))) - (should (equal (buffer-string) "int main ()\n{\n \n}")))) +;; Tests commented out, since C Mode does not use +;; electric-layout-mode. 2019-01-17, ACM + +;; (ert-deftest electric-layout-int-main-kernel-style () +;; (ert-with-test-buffer () +;; (c-mode) +;; (electric-layout-local-mode 1) +;; (electric-pair-local-mode 1) +;; (electric-indent-local-mode 1) +;; (setq-local electric-layout-rules +;; '((?\{ . (after-stay after)))) +;; (insert "int main () ") +;; (let ((last-command-event ?\{)) +;; (call-interactively (key-binding `[,last-command-event]))) +;; (should (equal (buffer-string) "int main () {\n \n}")))) + +;; (ert-deftest electric-layout-int-main-allman-style () +;; (ert-with-test-buffer () +;; (c-mode) +;; (electric-layout-local-mode 1) +;; (electric-pair-local-mode 1) +;; (electric-indent-local-mode 1) +;; (setq-local electric-layout-rules +;; '((?\{ . (before after-stay after)))) +;; (insert "int main () ") +;; (let ((last-command-event ?\{)) +;; (call-interactively (key-binding `[,last-command-event]))) +;; (should (equal (buffer-string) "int main ()\n{\n \n}")))) (define-derived-mode plainer-c-mode c-mode "pC" "A plainer/saner C-mode with no internal electric machinery." -- 2.39.2