diff options
| author | Dmitry Gutov | 2012-07-20 07:10:25 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-07-20 07:10:25 -0400 |
| commit | c28662a8dc4fefae711b21fcb7a71e871e37d1e6 (patch) | |
| tree | 37b6cf9b6caced945b938195028c95697fd2adf1 /test | |
| parent | 87ab808f0c0b2653a4a314d216c2afb44cfb2fc9 (diff) | |
| download | emacs-c28662a8dc4fefae711b21fcb7a71e871e37d1e6.tar.gz emacs-c28662a8dc4fefae711b21fcb7a71e871e37d1e6.zip | |
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): No error when end
up inside string symbol literal.
* test/automated/ruby-mode-tests.el: New file with one test.
Fixes: debbugs:11923
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 39 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index f82a395e548..db8380cfb27 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-07-20 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/ruby-mode-tests.el: New file with one test. | ||
| 4 | |||
| 1 | 2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * indent/shell.sh: Add test case for ${#VAR}. | 7 | * indent/shell.sh: Add test case for ${#VAR}. |
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el new file mode 100644 index 00000000000..1a91f518b92 --- /dev/null +++ b/test/automated/ruby-mode-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; ruby-mode-tests.el --- Test suite for ruby-mode | ||
| 2 | |||
| 3 | ;; Copyright (C) 2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'ruby-mode) | ||
| 25 | |||
| 26 | (ert-deftest indent-line-after-symbol-made-from-string-interpolation () | ||
| 27 | "It can indent the line after symbol made using string interpolation." | ||
| 28 | (let ((initial-content "def foo(suffix)\n :\"bar#{suffix}\"\n") | ||
| 29 | (expected-content "def foo(suffix)\n :\"bar#{suffix}\"\n ")) | ||
| 30 | (with-temp-buffer | ||
| 31 | (insert initial-content) | ||
| 32 | (ruby-indent-line) ; Doesn't rely on text properties or the syntax table. | ||
| 33 | (let ((buffer-content (buffer-substring-no-properties (point-min) | ||
| 34 | (point-max)))) | ||
| 35 | (should (string= buffer-content expected-content)))))) | ||
| 36 | |||
| 37 | (provide 'ruby-mode-tests) | ||
| 38 | |||
| 39 | ;;; ruby-mode-tests.el ends here | ||