* test/automated/ruby-mode-tests.el: Add tests for `ruby-forward-sexp'
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 6 Oct 2013 01:21:51 +0000 (04:21 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 6 Oct 2013 01:21:51 +0000 (04:21 +0300)
and `ruby-backward-sexp' that fail when `ruby-use-smie' is t.

* test/indent/ruby.rb: Two more failing examples.

test/ChangeLog
test/automated/ruby-mode-tests.el
test/indent/ruby.rb

index bc9addb..7392010 100644 (file)
@@ -1,5 +1,8 @@
 2013-10-06  Dmitry Gutov  <dgutov@yandex.ru>
 
+       * automated/ruby-mode-tests.el: Add tests for `ruby-forward-sexp'
+       and `ruby-backward-sexp' that fail when `ruby-use-smie' is t.
+
        * indent/ruby.rb: Fix a syntax error, add a few failing examples.
 
 2013-10-05  Stefan Monnier  <monnier@iro.umontreal.ca>
index ad805f1..861ab9b 100644 (file)
@@ -586,6 +586,30 @@ VALUES-PLIST is a list with alternating index and value elements."
     (end-of-defun)
     (should (= 5 (line-number-at-pos)))))
 
+;; Tests below fail when using SMIE.
+
+(defvar ruby-sexp-test-example
+  (ruby-test-string
+   "class C
+   |  def foo
+   |    self.end
+   |    D.new.class
+   |  end
+   |end"))
+
+(ert-deftest ruby-forward-sexp-skips-method-calls-with-keyword-names ()
+  (ruby-with-temp-buffer ruby-sexp-test-example
+    (goto-line 2)
+    (ruby-forward-sexp)
+    (should (= 5 (line-number-at-pos)))))
+
+(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names ()
+  (ruby-with-temp-buffer ruby-sexp-test-example
+    (goto-line 5)
+    (end-of-line)
+    (ruby-backward-sexp)
+    (should (= 2 (line-number-at-pos)))))
+
 (provide 'ruby-mode-tests)
 
 ;;; ruby-mode-tests.el ends here
index d52f4a3..9bb923e 100644 (file)
@@ -123,3 +123,9 @@ end
 
 desc "foo foo" \
   "bar bar"
+
+foo.
+  bar
+
+foo
+  .bar