summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/progmodes')
-rw-r--r--test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl2
-rw-r--r--test/lisp/progmodes/cperl-mode-tests.el2
-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
5 files changed, 38 insertions, 12 deletions
diff --git a/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl
index fa328438cb1..6d3f478595e 100644
--- a/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl
+++ b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl
@@ -1,4 +1,4 @@
-# The following Perl punctiation variables contain characters which
+# The following Perl punctuation variables contain characters which
# are classified as string delimiters in the syntax table. The mode
# should not be confused by these.
# The corresponding tests check that two consecutive '#' characters
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 1bb206e7040..96615c19383 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -114,7 +114,7 @@ end of the statement."
;;; Fontification tests
(ert-deftest cperl-test-fontify-punct-vars ()
- "Test fontification of Perl's punctiation variables.
+ "Test fontification of Perl's punctuation variables.
Perl has variable names containing unbalanced quotes for the list
separator $\" and pre- and postmatch $` and $'. A reference to
these variables, for example \\$\", should not cause the dollar
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 @@
+class C
+ def self.foo(
+ baz,
+ bar
+ ) =
+ what
+
+ def foo=(
+ baz,
+ bar
+ )
+ hello
+ end
+end
+
+# Local Variables:
+# ruby-method-params-indent: 0
+# 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
baz
end
end
+
+# Local Variables:
+# ruby-method-params-indent: t
+# 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."
"Blub#bye"
"Blub#hiding")))))
-(ert-deftest ruby--indent/converted-from-manual-test ()
- :tags '(:expensive-test)
- ;; Converted from manual test.
- (let ((buf (find-file-noselect (ert-resource-file "ruby.rb"))))
- (unwind-protect
- (with-current-buffer buf
- (let ((orig (buffer-string)))
- (indent-region (point-min) (point-max))
- (should (equal (buffer-string) orig))))
- (kill-buffer buf))))
+(defmacro ruby-deftest-indent (file)
+ `(ert-deftest ,(intern (format "ruby-indent-test/%s" file)) ()
+ ;; :tags '(:expensive-test)
+ (let ((buf (find-file-noselect (ert-resource-file ,file))))
+ (unwind-protect
+ (with-current-buffer buf
+ (let ((orig (buffer-string)))
+ ;; Indent and check that we get the original text.
+ (indent-region (point-min) (point-max))
+ (should (equal (buffer-string) orig))))
+ (kill-buffer buf)))))
+
+(ruby-deftest-indent "ruby.rb")
+(ruby-deftest-indent "ruby-method-params-indent.rb")
(ert-deftest ruby--test-chained-indentation ()
(with-temp-buffer