summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2013-02-14 07:33:55 +0400
committerDmitry Gutov <dgutov@yandex.ru>2013-02-14 07:33:55 +0400
commit53ca88c478b773f2b56084442c8d17e83577f52c (patch)
tree53c4a4346dd423000de81ed52bd14b2d104f5237 /test
parent6b26f14f789112bb929f65a8d44caeda11418432 (diff)
downloademacs-53ca88c478b773f2b56084442c8d17e83577f52c.tar.gz
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): Don't increase
depth for unfinished percent literal. Not using it in the caller. (ruby-move-to-block): Jump over multiline literals of all types, ignoring code-looking contents inside them. * test/automated/ruby-mode-tests.el (ruby-move-to-block-skips-percent-literal): Add depth-affecting bits inside the examples. (ruby-move-to-block-skips-heredoc): New test.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog7
-rw-r--r--test/automated/ruby-mode-tests.el19
2 files changed, 25 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index f508209008e..7e08eccc2e3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-14 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el
+ (ruby-move-to-block-skips-percent-literal): Add depth-affecting
+ bits inside the examples.
+ (ruby-move-to-block-skips-heredoc): New test.
+
2013-02-13 Dmitry Gutov <dgutov@yandex.ru>
* automated/ruby-mode-tests.el
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 6798a49d53c..9ee6462f6ad 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -449,20 +449,37 @@ VALUES-PLIST is a list with alternating index and value elements."
(dolist (s (list (ruby-test-string
"foo do
| a = %%w(
+ | def yaa
| )
|end")
(ruby-test-string
"foo do
| a = %%w|
+ | end
| |
|end")))
(ruby-with-temp-buffer s
(goto-line 1)
(ruby-end-of-block)
- (should (= 4 (line-number-at-pos)))
+ (should (= 5 (line-number-at-pos)))
(ruby-beginning-of-block)
(should (= 1 (line-number-at-pos))))))
+(ert-deftest ruby-move-to-block-skips-heredoc ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "if something_wrong?
+ | ActiveSupport::Deprecation.warn(<<-eowarn)
+ | boo hoo
+ | end
+ | eowarn
+ |end")
+ (goto-line 1)
+ (ruby-end-of-block)
+ (should (= 6 (line-number-at-pos)))
+ (ruby-beginning-of-block)
+ (should (= 1 (line-number-at-pos)))))
+
(provide 'ruby-mode-tests)
;;; ruby-mode-tests.el ends here