summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2017-02-13 17:07:36 +0530
committerVibhav Pant <vibhavp@gmail.com>2017-02-13 17:07:36 +0530
commitcb410433e069b5bb450193353c3fea8593a643a9 (patch)
treed2f4269781b4841e5a0c27ec57a5a4fbcec386c0 /test
parente742450427007cdde242c11380dfe32a950fab61 (diff)
parent4b18ef7ba3dd8aae4f3c3bf931365ef7da883baf (diff)
downloademacs-feature/byte-switch.tar.gz
Merge branch 'master' into feature/byte-switchfeature/byte-switch
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/js-tests.el17
-rw-r--r--test/lisp/textmodes/css-mode-tests.el3
-rw-r--r--test/src/fns-tests.el18
3 files changed, 28 insertions, 10 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))
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 160d0f106e9..a1b48a643e1 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -473,12 +473,12 @@
(should (lax-plist-get d2 1))
(should-error (lax-plist-get c1 2) :type 'circular-list)
(should (lax-plist-get c2 2))
- (should-not (lax-plist-get d1 2))
+ (should-error (lax-plist-get d1 2) :type 'wrong-type-argument)
(should (lax-plist-get d2 2))
(should-error (lax-plist-get c1 3) :type 'circular-list)
(should-error (lax-plist-get c2 3) :type 'circular-list)
- (should-not (lax-plist-get d1 3))
- (should-not (lax-plist-get d2 3))))
+ (should-error (lax-plist-get d1 3) :type 'wrong-type-argument)
+ (should-error (lax-plist-get d2 3) :type 'wrong-type-argument)))
(ert-deftest test-cycle-plist-member ()
(let ((c1 (cyc1 1))
@@ -509,12 +509,12 @@
(should (plist-put d2 1 1))
(should-error (plist-put c1 2 2) :type 'circular-list)
(should (plist-put c2 2 2))
- (should (plist-put d1 2 2))
+ (should-error (plist-put d1 2 2) :type 'wrong-type-argument)
(should (plist-put d2 2 2))
(should-error (plist-put c1 3 3) :type 'circular-list)
(should-error (plist-put c2 3 3) :type 'circular-list)
- (should (plist-put d1 3 3))
- (should (plist-put d2 3 3))))
+ (should-error (plist-put d1 3 3) :type 'wrong-type-argument)
+ (should-error (plist-put d2 3 3) :type 'wrong-type-argument)))
(ert-deftest test-cycle-lax-plist-put ()
(let ((c1 (cyc1 1))
@@ -527,12 +527,12 @@
(should (lax-plist-put d2 1 1))
(should-error (lax-plist-put c1 2 2) :type 'circular-list)
(should (lax-plist-put c2 2 2))
- (should (lax-plist-put d1 2 2))
+ (should-error (lax-plist-put d1 2 2) :type 'wrong-type-argument)
(should (lax-plist-put d2 2 2))
(should-error (lax-plist-put c1 3 3) :type 'circular-list)
(should-error (lax-plist-put c2 3 3) :type 'circular-list)
- (should (lax-plist-put d1 3 3))
- (should (lax-plist-put d2 3 3))))
+ (should-error (lax-plist-put d1 3 3) :type 'wrong-type-argument)
+ (should-error (lax-plist-put d2 3 3) :type 'wrong-type-argument)))
(ert-deftest test-cycle-equal ()
(should-error (equal (cyc1 1) (cyc1 1)))