aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2013-10-09 06:18:01 +0300
committerDmitry Gutov2013-10-09 06:18:01 +0300
commit238150c8ff55ab6d74f0fdcc7f163c8ee98c3749 (patch)
treec349bb1dd0dca3f33983368d1aeb93b539d67532 /test
parentb0949cc4c9edcfea541ad72ee5e7579fac7466e1 (diff)
downloademacs-238150c8ff55ab6d74f0fdcc7f163c8ee98c3749.tar.gz
emacs-238150c8ff55ab6d74f0fdcc7f163c8ee98c3749.zip
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after hanging
iuwu-mod token. (ruby-smie--implicit-semi-p): Prohibit implicit semicolon after hanging iuwu-mod token. (ruby-smie--forward-token): Do not include a dot after a token in that token. (ruby-smie--backward-token): Likewise.
Diffstat (limited to 'test')
-rw-r--r--test/automated/ruby-mode-tests.el7
-rw-r--r--test/indent/ruby.rb8
2 files changed, 11 insertions, 4 deletions
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 861ab9b6125..86b123f9b14 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -594,6 +594,9 @@ VALUES-PLIST is a list with alternating index and value elements."
594 | def foo 594 | def foo
595 | self.end 595 | self.end
596 | D.new.class 596 | D.new.class
597 | [1, 2, 3].map do |i|
598 | i + 1
599 | end.sum
597 | end 600 | end
598 |end")) 601 |end"))
599 602
@@ -601,11 +604,11 @@ VALUES-PLIST is a list with alternating index and value elements."
601 (ruby-with-temp-buffer ruby-sexp-test-example 604 (ruby-with-temp-buffer ruby-sexp-test-example
602 (goto-line 2) 605 (goto-line 2)
603 (ruby-forward-sexp) 606 (ruby-forward-sexp)
604 (should (= 5 (line-number-at-pos))))) 607 (should (= 8 (line-number-at-pos)))))
605 608
606(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names () 609(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names ()
607 (ruby-with-temp-buffer ruby-sexp-test-example 610 (ruby-with-temp-buffer ruby-sexp-test-example
608 (goto-line 5) 611 (goto-line 8)
609 (end-of-line) 612 (end-of-line)
610 (ruby-backward-sexp) 613 (ruby-backward-sexp)
611 (should (= 2 (line-number-at-pos))))) 614 (should (= 2 (line-number-at-pos)))))
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index 2b2b95bf47b..48275ee3e31 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -148,10 +148,14 @@ z = {
148 } 148 }
149} 149}
150 150
151foo if
152 bar
153
151# Examples below still fail with `ruby-use-smie' on: 154# Examples below still fail with `ruby-use-smie' on:
152 155
153foo + 156foo +
154 bar 157 bar
155 158
156foo if 159foo = [1, 2, 3].map do |i|
157 bar 160 i + 1
161end