aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2013-02-14 07:33:55 +0400
committerDmitry Gutov2013-02-14 07:33:55 +0400
commit53ca88c478b773f2b56084442c8d17e83577f52c (patch)
tree53c4a4346dd423000de81ed52bd14b2d104f5237 /test
parent6b26f14f789112bb929f65a8d44caeda11418432 (diff)
downloademacs-53ca88c478b773f2b56084442c8d17e83577f52c.tar.gz
emacs-53ca88c478b773f2b56084442c8d17e83577f52c.zip
* 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 @@
12013-02-14 Dmitry Gutov <dgutov@yandex.ru>
2
3 * automated/ruby-mode-tests.el
4 (ruby-move-to-block-skips-percent-literal): Add depth-affecting
5 bits inside the examples.
6 (ruby-move-to-block-skips-heredoc): New test.
7
12013-02-13 Dmitry Gutov <dgutov@yandex.ru> 82013-02-13 Dmitry Gutov <dgutov@yandex.ru>
2 9
3 * automated/ruby-mode-tests.el 10 * 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."
449 (dolist (s (list (ruby-test-string 449 (dolist (s (list (ruby-test-string
450 "foo do 450 "foo do
451 | a = %%w( 451 | a = %%w(
452 | def yaa
452 | ) 453 | )
453 |end") 454 |end")
454 (ruby-test-string 455 (ruby-test-string
455 "foo do 456 "foo do
456 | a = %%w| 457 | a = %%w|
458 | end
457 | | 459 | |
458 |end"))) 460 |end")))
459 (ruby-with-temp-buffer s 461 (ruby-with-temp-buffer s
460 (goto-line 1) 462 (goto-line 1)
461 (ruby-end-of-block) 463 (ruby-end-of-block)
462 (should (= 4 (line-number-at-pos))) 464 (should (= 5 (line-number-at-pos)))
463 (ruby-beginning-of-block) 465 (ruby-beginning-of-block)
464 (should (= 1 (line-number-at-pos)))))) 466 (should (= 1 (line-number-at-pos))))))
465 467
468(ert-deftest ruby-move-to-block-skips-heredoc ()
469 (ruby-with-temp-buffer
470 (ruby-test-string
471 "if something_wrong?
472 | ActiveSupport::Deprecation.warn(<<-eowarn)
473 | boo hoo
474 | end
475 | eowarn
476 |end")
477 (goto-line 1)
478 (ruby-end-of-block)
479 (should (= 6 (line-number-at-pos)))
480 (ruby-beginning-of-block)
481 (should (= 1 (line-number-at-pos)))))
482
466(provide 'ruby-mode-tests) 483(provide 'ruby-mode-tests)
467 484
468;;; ruby-mode-tests.el ends here 485;;; ruby-mode-tests.el ends here