aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2013-05-31 10:04:33 +0400
committerDmitry Gutov2013-05-31 10:04:33 +0400
commit19bb8e629352f9438e95e62559bf73940cd3d885 (patch)
treee3961dcd8917d9bd15873252ac0c87534119cac5 /test
parentfc186a96df6853da2a94b76b40b6f3f8b24e52ac (diff)
downloademacs-19bb8e629352f9438e95e62559bf73940cd3d885.tar.gz
emacs-19bb8e629352f9438e95e62559bf73940cd3d885.zip
* lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): New
function, checks if expression expansion is allowed in given parse state. (ruby-syntax-propertize-expansion): Use it. (ruby-syntax-propertize-function): Bind `case-fold-search' to nil around the body. * test/automated/ruby-mode-tests.el: New tests, for percent literals and expression expansion.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/ruby-mode-tests.el17
2 files changed, 22 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 56e019ec4af..98fb2e3da1f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
12013-05-31 Dmitry Gutov <dgutov@yandex.ru>
2
3 * automated/ruby-mode-tests.el: New tests, for percent literals
4 and expression expansion.
5
12013-05-29 Leo Liu <sdl.web@gmail.com> 62013-05-29 Leo Liu <sdl.web@gmail.com>
2 7
3 * indent/octave.m: Tweak. 8 * indent/octave.m: Tweak.
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index e52927a2968..6ed2a8ad377 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -353,6 +353,23 @@ VALUES-PLIST is a list with alternating index and value elements."
353 ;; It's confused by the closing paren in the middle. 353 ;; It's confused by the closing paren in the middle.
354 (ruby-assert-state s 8 nil))) 354 (ruby-assert-state s 8 nil)))
355 355
356(ert-deftest ruby-interpolation-inside-double-quoted-percent-literals ()
357 (ruby-assert-face "%Q{foo #@bar}" 8 font-lock-variable-name-face)
358 (ruby-assert-face "%W{foo #@bar}" 8 font-lock-variable-name-face)
359 (ruby-assert-face "%r{foo #@bar}" 8 font-lock-variable-name-face)
360 (ruby-assert-face "%x{foo #@bar}" 8 font-lock-variable-name-face))
361
362(ert-deftest ruby-no-interpolation-in-single-quoted-literals ()
363 (ruby-assert-face "'foo #@bar'" 7 font-lock-string-face)
364 (ruby-assert-face "%q{foo #@bar}" 8 font-lock-string-face)
365 (ruby-assert-face "%w{foo #@bar}" 8 font-lock-string-face)
366 (ruby-assert-face "%s{foo #@bar}" 8 font-lock-string-face))
367
368(ert-deftest ruby-no-unknown-percent-literals ()
369 ;; No folding of case.
370 (ruby-assert-face "%S{foo}" 4 nil)
371 (ruby-assert-face "%R{foo}" 4 nil))
372
356(ert-deftest ruby-add-log-current-method-examples () 373(ert-deftest ruby-add-log-current-method-examples ()
357 (let ((pairs '(("foo" . "#foo") 374 (let ((pairs '(("foo" . "#foo")
358 ("C.foo" . ".foo") 375 ("C.foo" . ".foo")