summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2016-03-08 15:46:19 +0200
committerDmitry Gutov <dgutov@yandex.ru>2016-03-09 17:22:56 +0200
commit366ec7719f3cfde5f003d97ae9f5d02609827b0c (patch)
tree72ac583d68224497c7486d5edf6f89a00b23d74d /test
parent02bf7cc4632dae6bd679f34307fc83ccc8510471 (diff)
downloademacs-366ec7719f3cfde5f003d97ae9f5d02609827b0c.tar.gz
Allow using the left shift operator without spaces on both sides
* lisp/progmodes/ruby-mode.el (ruby-singleton-class-p): Rename to ruby-verify-heredoc, reverse the meaning of the return value, and short-circuit if preceded by a symbol not separated by whitespace. * test/automated/ruby-mode-tests.el (ruby-no-heredoc-left-shift) (ruby-no-heredoc-class-self): New tests.
Diffstat (limited to 'test')
-rw-r--r--test/automated/ruby-mode-tests.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 7073f7a04e2..4fa7470218a 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -91,6 +91,15 @@ VALUES-PLIST is a list with alternating index and value elements."
(ert-deftest ruby-no-heredoc-inside-quotes ()
(ruby-assert-state "\"<<\", \"\",\nfoo" 3 nil))
+(ert-deftest ruby-no-heredoc-left-shift ()
+ ;; We can't really detect the left shift operator (like in similar
+ ;; cases, it depends on the type of foo), so we just require for <<
+ ;; to be preceded by a character from a known set.
+ (ruby-assert-state "foo(a<<b)" 3 nil))
+
+(ert-deftest ruby-no-heredoc-class-self ()
+ (ruby-assert-state "class <<self\nend" 3 nil))
+
(ert-deftest ruby-exit!-font-lock ()
(ruby-assert-face "exit!" 5 font-lock-builtin-face))