aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky2017-02-11 23:15:13 -0500
committerNoam Postavsky2017-02-14 22:29:56 -0500
commit0a64666288e3f32967db4ad683a4bc2f225fb952 (patch)
tree2f235f41d4c44bd7f218a006b59d03feb4eab672 /test
parent61ea36bb37740315dc78ba213db51c508c489f25 (diff)
downloademacs-0a64666288e3f32967db4ad683a4bc2f225fb952.tar.gz
emacs-0a64666288e3f32967db4ad683a4bc2f225fb952.zip
Test comment-multi-line = nil auto fill case too
* test/lisp/progmodes/js-tests.el (js-mode-auto-fill): Test with `comment-multi-line' both nil and non-nil. * lisp/newcomment.el (comment-multi-line): Mark safe if it's a boolean. * etc/NEWS: Mention that `js-mode' now sets `comment-multi-line'.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/js-tests.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index d61f084e0df..99f5898525b 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -89,16 +89,18 @@ if (!/[ (:,='\"]/.test(value)) {
89(ert-deftest js-mode-auto-fill () 89(ert-deftest js-mode-auto-fill ()
90 (with-temp-buffer 90 (with-temp-buffer
91 (js-mode) 91 (js-mode)
92 (setq fill-column 70) 92 (let ((fill-column 10)
93 (insert "/* ") 93 (comment-multi-line t))
94 (dotimes (_ 16) 94 (insert "/* test test")
95 (insert "test ")) 95 (do-auto-fill)
96 (do-auto-fill) 96 ;; Filling should continue the multi line comment.
97 ;; The bug is that, after auto-fill, the second line starts with 97 (should (equal (buffer-string) "/* test\n * test"))
98 ;; "/*", whereas it should start with " * ". 98 (erase-buffer)
99 (goto-char (point-min)) 99 (insert "/* test test")
100 (forward-line) 100 (setq comment-multi-line nil)
101 (should (looking-at " \\* test")))) 101 (do-auto-fill)
102 ;; Filling should start a new comment on the next line.
103 (should (equal (buffer-string) "/* test */\n/* test")))))
102 104
103(ert-deftest js-mode-regexp-syntax-bug-25529 () 105(ert-deftest js-mode-regexp-syntax-bug-25529 ()
104 (dolist (regexp-contents '("[^[]" 106 (dolist (regexp-contents '("[^[]"