From 7318480cec373d97bb98b50746c433c4db59a6b8 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 6 Oct 2013 04:21:51 +0300 Subject: [PATCH] * test/automated/ruby-mode-tests.el: Add tests for `ruby-forward-sexp' and `ruby-backward-sexp' that fail when `ruby-use-smie' is t. * test/indent/ruby.rb: Two more failing examples. --- test/ChangeLog | 3 +++ test/automated/ruby-mode-tests.el | 24 ++++++++++++++++++++++++ test/indent/ruby.rb | 6 ++++++ 3 files changed, 33 insertions(+) diff --git a/test/ChangeLog b/test/ChangeLog index bc9addb810b..7392010cb93 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,8 @@ 2013-10-06 Dmitry Gutov + * 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 diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index ad805f16777..861ab9b6125 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el @@ -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 diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index d52f4a3e6f6..9bb923ebbdf 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -123,3 +123,9 @@ end desc "foo foo" \ "bar bar" + +foo. + bar + +foo + .bar -- 2.39.2