diff options
Diffstat (limited to 'test/lisp')
-rw-r--r-- | test/lisp/progmodes/js-tests.el | 17 | ||||
-rw-r--r-- | test/lisp/textmodes/css-mode-tests.el | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 7cb737c30e2..d61f084e0df 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -23,6 +23,7 @@ (require 'ert) (require 'js) +(require 'syntax) (ert-deftest js-mode-fill-bug-19399 () (with-temp-buffer @@ -99,6 +100,22 @@ if (!/[ (:,='\"]/.test(value)) { (forward-line) (should (looking-at " \\* test")))) +(ert-deftest js-mode-regexp-syntax-bug-25529 () + (dolist (regexp-contents '("[^[]" + "[/]" + ;; A comment with the regexp on the next + ;; line. + "*comment*/\n/regexp")) + (with-temp-buffer + (js-mode) + (insert "let x = /" regexp-contents "/;\n") + (save-excursion (insert "something();\n")) + ;; The failure mode was that the regexp literal was not + ;; recognized, causing the next line to be given string syntax; + ;; but check for comment syntax as well to prevent an + ;; implementation not recognizing the comment example. + (should-not (syntax-ppss-context (syntax-ppss)))))) + (provide 'js-tests) ;;; js-tests.el ends here diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 5372c37a179..d601f43002a 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -226,7 +226,8 @@ ("a:v" "isited" ":visited") ("border-" "color: red" "border-color") ("border-color: red" ";" "border-color") - ("border-color: red; color: green" ";" "color"))) + ("border-color: red; color: green" ";" "color") + (" border-collapse " ": collapse;" "border-collapse"))) (with-temp-buffer (css-mode) (insert (nth 0 item)) |