aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/progmodes')
-rw-r--r--test/lisp/progmodes/js-tests.el14
-rw-r--r--test/lisp/progmodes/python-tests.el23
2 files changed, 36 insertions, 1 deletions
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index 84749efa45b..7cb737c30e2 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -85,6 +85,20 @@ if (!/[ (:,='\"]/.test(value)) {
85 (should (= (current-column) x)) 85 (should (= (current-column) x))
86 (forward-line)))) 86 (forward-line))))
87 87
88(ert-deftest js-mode-auto-fill ()
89 (with-temp-buffer
90 (js-mode)
91 (setq fill-column 70)
92 (insert "/* ")
93 (dotimes (_ 16)
94 (insert "test "))
95 (do-auto-fill)
96 ;; The bug is that, after auto-fill, the second line starts with
97 ;; "/*", whereas it should start with " * ".
98 (goto-char (point-min))
99 (forward-line)
100 (should (looking-at " \\* test"))))
101
88(provide 'js-tests) 102(provide 'js-tests)
89 103
90;;; js-tests.el ends here 104;;; js-tests.el ends here
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 2df1bbf50d8..1e6b867d30b 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1156,6 +1156,27 @@ if do:
1156 (python-tests-look-at "that)") 1156 (python-tests-look-at "that)")
1157 (should (= (current-indentation) 6)))) 1157 (should (= (current-indentation) 6))))
1158 1158
1159(ert-deftest python-indent-electric-colon-4 ()
1160 "Test indentation case where there is one more-indented previous open block."
1161 (python-tests-with-temp-buffer
1162 "
1163def f():
1164 if True:
1165 a = 5
1166
1167 if True:
1168 a = 10
1169
1170 b = 3
1171
1172else
1173"
1174 (python-tests-look-at "else")
1175 (goto-char (line-end-position))
1176 (python-tests-self-insert ":")
1177 (python-tests-look-at "else" -1)
1178 (should (= (current-indentation) 4))))
1179
1159(ert-deftest python-indent-region-1 () 1180(ert-deftest python-indent-region-1 ()
1160 "Test indentation case from Bug#18843." 1181 "Test indentation case from Bug#18843."
1161 (let ((contents " 1182 (let ((contents "
@@ -2457,7 +2478,7 @@ if x:
2457 (python-tests-with-temp-buffer 2478 (python-tests-with-temp-buffer
2458 " \"\n" 2479 " \"\n"
2459 (goto-char (point-min)) 2480 (goto-char (point-min))
2460 (font-lock-fontify-buffer))) 2481 (call-interactively 'font-lock-fontify-buffer)))
2461 2482
2462 2483
2463;;; Shell integration 2484;;; Shell integration