diff options
| author | Dmitry Gutov | 2016-03-08 15:46:19 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2016-03-09 17:22:56 +0200 |
| commit | 366ec7719f3cfde5f003d97ae9f5d02609827b0c (patch) | |
| tree | 72ac583d68224497c7486d5edf6f89a00b23d74d /test | |
| parent | 02bf7cc4632dae6bd679f34307fc83ccc8510471 (diff) | |
| download | emacs-366ec7719f3cfde5f003d97ae9f5d02609827b0c.tar.gz emacs-366ec7719f3cfde5f003d97ae9f5d02609827b0c.zip | |
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.el | 9 |
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." | |||
| 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 | ||