diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/automated/ruby-mode-tests.el | 22 |
2 files changed, 26 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 142dfcb42fd..ccebdda7411 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2012-12-14 Dmitry Gutov <dgutov@yandex.ru> + + * automated/ruby-mode-tests.el + Rename one interpolation test; add three more. + 2012-12-11 Glenn Morris <rgm@gnu.org> * automated/f90.el (f90-test-bug13138): New test. diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index 620fe72fb69..6ae23f94f1a 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -276,13 +276,33 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16 font-lock-variable-name-face)) -(ert-deftest ruby-interpolation-suppresses-syntax-inside () +(ert-deftest ruby-interpolation-suppresses-quotes-inside () (let ((s "\"<ul><li>#{@files.join(\"</li><li>\")}</li></ul>\"")) (ruby-assert-state s 8 nil) (ruby-assert-face s 9 font-lock-string-face) (ruby-assert-face s 10 font-lock-variable-name-face) (ruby-assert-face s 41 font-lock-string-face))) +(ert-deftest ruby-interpolation-suppresses-one-double-quote () + (let ((s "\"foo#{'\"'}\"")) + (ruby-assert-state s 8 nil) + (ruby-assert-face s 8 font-lock-variable-name-face) + (ruby-assert-face s 11 font-lock-string-face))) + +(ert-deftest ruby-interpolation-suppresses-one-backtick () + (let ((s "`as#{'`'}das`")) + (ruby-assert-state s 8 nil))) + +(ert-deftest ruby-interpolation-keeps-non-quote-syntax () + (let ((s "\"foo#{baz.tee}bar\"")) + (with-temp-buffer + (save-excursion + (insert s)) + (ruby-mode) + (font-lock-fontify-buffer) + (search-forward "tee") + (should (string= (thing-at-point 'symbol) "tee"))))) + (ert-deftest ruby-interpolation-inside-percent-literal-with-paren () :expected-result :failed (let ((s "%(^#{\")\"}^)")) |