aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Kangas2022-12-21 02:37:17 +0100
committerStefan Kangas2022-12-21 02:37:17 +0100
commit2bbc554db63cc5cc140ade5bfcbbf53ecd18f5ae (patch)
tree044d6aa99d0ef54ace6c01583231c1ae286c8865 /test/lisp/progmodes
parent1424342225ef5b18c630364dd88e004f4ebb1c7f (diff)
parentd3a76db88b4357fe1c92f240796ea9b522b97a8e (diff)
downloademacs-2bbc554db63cc5cc140ade5bfcbbf53ecd18f5ae.tar.gz
emacs-2bbc554db63cc5cc140ade5bfcbbf53ecd18f5ae.zip
Merge from origin/emacs-29
d3a76db88b4 * lisp/repeat.el: Fix repeat-keep-prefix to allow customi... 8ef3777d544 Correct capitalization of Lisp in the manual (bug#60222) d03ea893780 eglot.el: Add vscode-json-languageserver to eglot-server-... 8550a993785 ; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix ... fb7f3999c59 ; Fix ruby-method-params-indent's :version value cfbfd393b45 * lisp/progmodes/project.el (project--read-file-cpd-relat... 2b1fdbffcb5 ruby-method-params-indent: New user option b9e813f79f2 ; ruby-indent-level: Improve the docstring 399433cc2b9 * lisp/progmodes/project.el: Filter out empty strings fro... 23f7c9c2a92 Fix storing email into nnmail by Gnus 63cdbd986bb ; Really respect browse-url var in erc-compat 64163618d21 whitespace: Fix unintended change in buffer modification ... a75d1da911c Make emacsclient add abbreviated file names to file-name-... b3e7768a0ee Repair setopt test after error demotion to warning
Diffstat (limited to 'test/lisp/progmodes')
-rw-r--r--test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb18
-rw-r--r--test/lisp/progmodes/ruby-mode-resources/ruby.rb4
-rw-r--r--test/lisp/progmodes/ruby-mode-tests.el24
3 files changed, 36 insertions, 10 deletions
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb
new file mode 100644
index 00000000000..2b665797397
--- /dev/null
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb
@@ -0,0 +1,18 @@
1class C
2 def self.foo(
3 baz,
4 bar
5 ) =
6 what
7
8 def foo=(
9 baz,
10 bar
11 )
12 hello
13 end
14end
15
16# Local Variables:
17# ruby-method-params-indent: 0
18# End:
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
index 2451edaee22..6a69d9db78a 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb
@@ -538,3 +538,7 @@ class Bar
538 baz 538 baz
539 end 539 end
540end 540end
541
542# Local Variables:
543# ruby-method-params-indent: t
544# End:
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el
index 9be01dc78f9..560f780285a 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -943,16 +943,20 @@ VALUES-PLIST is a list with alternating index and value elements."
943 "Blub#bye" 943 "Blub#bye"
944 "Blub#hiding"))))) 944 "Blub#hiding")))))
945 945
946(ert-deftest ruby--indent/converted-from-manual-test () 946(defmacro ruby-deftest-indent (file)
947 :tags '(:expensive-test) 947 `(ert-deftest ,(intern (format "ruby-indent-test/%s" file)) ()
948 ;; Converted from manual test. 948 ;; :tags '(:expensive-test)
949 (let ((buf (find-file-noselect (ert-resource-file "ruby.rb")))) 949 (let ((buf (find-file-noselect (ert-resource-file ,file))))
950 (unwind-protect 950 (unwind-protect
951 (with-current-buffer buf 951 (with-current-buffer buf
952 (let ((orig (buffer-string))) 952 (let ((orig (buffer-string)))
953 (indent-region (point-min) (point-max)) 953 ;; Indent and check that we get the original text.
954 (should (equal (buffer-string) orig)))) 954 (indent-region (point-min) (point-max))
955 (kill-buffer buf)))) 955 (should (equal (buffer-string) orig))))
956 (kill-buffer buf)))))
957
958(ruby-deftest-indent "ruby.rb")
959(ruby-deftest-indent "ruby-method-params-indent.rb")
956 960
957(ert-deftest ruby--test-chained-indentation () 961(ert-deftest ruby--test-chained-indentation ()
958 (with-temp-buffer 962 (with-temp-buffer