aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov <[email protected]>2012-12-14 08:55:23 +0400
committerDmitry Gutov <[email protected]>2012-12-14 08:55:23 +0400
commitdbb530d9887fd51de9f8e338b325537d9eac0a3a (patch)
tree491ec463feca7a9993c5462a28e18e68ae70fb3c /test
parentfd1b1e2ed2efb9891ae3a709d62151a52e937bd6 (diff)
* 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/ChangeLog5
-rw-r--r--test/automated/ruby-mode-tests.el22
2 files changed, 26 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 142dfcb42f..ccebdda741 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-14 Dmitry Gutov <[email protected]>
+
+ * automated/ruby-mode-tests.el
+ Rename one interpolation test; add three more.
+
2012-12-11 Glenn Morris <[email protected]>
* 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 620fe72fb6..6ae23f94f1 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 "%(^#{\")\"}^)"))