diff options
| author | Dmitry Gutov | 2012-12-14 08:55:23 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2012-12-14 08:55:23 +0400 |
| commit | dbb530d9887fd51de9f8e338b325537d9eac0a3a (patch) | |
| tree | 491ec463feca7a9993c5462a28e18e68ae70fb3c /test | |
| parent | fd1b1e2ed2efb9891ae3a709d62151a52e937bd6 (diff) | |
| download | emacs-dbb530d9887fd51de9f8e338b325537d9eac0a3a.tar.gz emacs-dbb530d9887fd51de9f8e338b325537d9eac0a3a.zip | |
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Extract `ruby-syntax-propertize-expansions'.
(ruby-syntax-propertize-expansions): Only change syntax on
certain string delimiters, to punctuation. This way the common
functions like forward-word and thing-at-point still work.
* test/automated/ruby-mode-tests.el
Rename one interpolation test; add three more.
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 @@ | |||
| 1 | 2012-12-14 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/ruby-mode-tests.el | ||
| 4 | Rename one interpolation test; add three more. | ||
| 5 | |||
| 1 | 2012-12-11 Glenn Morris <rgm@gnu.org> | 6 | 2012-12-11 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * automated/f90.el (f90-test-bug13138): New test. | 8 | * 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." | |||
| 276 | (ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16 | 276 | (ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16 |
| 277 | font-lock-variable-name-face)) | 277 | font-lock-variable-name-face)) |
| 278 | 278 | ||
| 279 | (ert-deftest ruby-interpolation-suppresses-syntax-inside () | 279 | (ert-deftest ruby-interpolation-suppresses-quotes-inside () |
| 280 | (let ((s "\"<ul><li>#{@files.join(\"</li><li>\")}</li></ul>\"")) | 280 | (let ((s "\"<ul><li>#{@files.join(\"</li><li>\")}</li></ul>\"")) |
| 281 | (ruby-assert-state s 8 nil) | 281 | (ruby-assert-state s 8 nil) |
| 282 | (ruby-assert-face s 9 font-lock-string-face) | 282 | (ruby-assert-face s 9 font-lock-string-face) |
| 283 | (ruby-assert-face s 10 font-lock-variable-name-face) | 283 | (ruby-assert-face s 10 font-lock-variable-name-face) |
| 284 | (ruby-assert-face s 41 font-lock-string-face))) | 284 | (ruby-assert-face s 41 font-lock-string-face))) |
| 285 | 285 | ||
| 286 | (ert-deftest ruby-interpolation-suppresses-one-double-quote () | ||
| 287 | (let ((s "\"foo#{'\"'}\"")) | ||
| 288 | (ruby-assert-state s 8 nil) | ||
| 289 | (ruby-assert-face s 8 font-lock-variable-name-face) | ||
| 290 | (ruby-assert-face s 11 font-lock-string-face))) | ||
| 291 | |||
| 292 | (ert-deftest ruby-interpolation-suppresses-one-backtick () | ||
| 293 | (let ((s "`as#{'`'}das`")) | ||
| 294 | (ruby-assert-state s 8 nil))) | ||
| 295 | |||
| 296 | (ert-deftest ruby-interpolation-keeps-non-quote-syntax () | ||
| 297 | (let ((s "\"foo#{baz.tee}bar\"")) | ||
| 298 | (with-temp-buffer | ||
| 299 | (save-excursion | ||
| 300 | (insert s)) | ||
| 301 | (ruby-mode) | ||
| 302 | (font-lock-fontify-buffer) | ||
| 303 | (search-forward "tee") | ||
| 304 | (should (string= (thing-at-point 'symbol) "tee"))))) | ||
| 305 | |||
| 286 | (ert-deftest ruby-interpolation-inside-percent-literal-with-paren () | 306 | (ert-deftest ruby-interpolation-inside-percent-literal-with-paren () |
| 287 | :expected-result :failed | 307 | :expected-result :failed |
| 288 | (let ((s "%(^#{\")\"}^)")) | 308 | (let ((s "%(^#{\")\"}^)")) |