aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/progmodes/ruby-mode-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el
index da8d77c5157..4fa7470218a 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -91,6 +91,15 @@ VALUES-PLIST is a list with alternating index and value elements."
91(ert-deftest ruby-no-heredoc-inside-quotes () 91(ert-deftest ruby-no-heredoc-inside-quotes ()
92 (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil)) 92 (ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil))
93 93
94(ert-deftest ruby-no-heredoc-left-shift ()
95 ;; We can't really detect the left shift operator (like in similar
96 ;; cases, it depends on the type of foo), so we just require for <<
97 ;; to be preceded by a character from a known set.
98 (ruby-assert-state "foo(a<<b)" 3 nil))
99
100(ert-deftest ruby-no-heredoc-class-self ()
101 (ruby-assert-state "class <<self\nend" 3 nil))
102
94(ert-deftest ruby-exit!-font-lock () 103(ert-deftest ruby-exit!-font-lock ()
95 (ruby-assert-face "exit!" 5 font-lock-builtin-face)) 104 (ruby-assert-face "exit!" 5 font-lock-builtin-face))
96 105
@@ -461,6 +470,14 @@ VALUES-PLIST is a list with alternating index and value elements."
461 (ruby-assert-face "%S{foo}" 4 nil) 470 (ruby-assert-face "%S{foo}" 4 nil)
462 (ruby-assert-face "%R{foo}" 4 nil)) 471 (ruby-assert-face "%R{foo}" 4 nil))
463 472
473(ert-deftest ruby-no-nested-percent-literals ()
474 (ruby-with-temp-buffer "a = %w[b %()]"
475 (syntax-propertize (point))
476 (should (null (nth 8 (syntax-ppss))))
477 (should (eq t (nth 3 (syntax-ppss (1- (point-max))))))
478 (search-backward "[")
479 (should (eq t (nth 3 (syntax-ppss))))))
480
464(ert-deftest ruby-add-log-current-method-examples () 481(ert-deftest ruby-add-log-current-method-examples ()
465 (let ((pairs '(("foo" . "#foo") 482 (let ((pairs '(("foo" . "#foo")
466 ("C.foo" . ".foo") 483 ("C.foo" . ".foo")