summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-12-21 02:37:17 +0100
committerStefan Kangas <stefankangas@gmail.com>2022-12-21 02:37:17 +0100
commit2bbc554db63cc5cc140ade5bfcbbf53ecd18f5ae (patch)
tree044d6aa99d0ef54ace6c01583231c1ae286c8865 /test
parent1424342225ef5b18c630364dd88e004f4ebb1c7f (diff)
parentd3a76db88b4357fe1c92f240796ea9b522b97a8e (diff)
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')
-rw-r--r--test/lisp/cus-edit-tests.el11
-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
-rw-r--r--test/lisp/repeat-tests.el30
-rw-r--r--test/lisp/whitespace-tests.el10
6 files changed, 71 insertions, 26 deletions
diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el
index 0ef5168109b..31ba68b4107 100644
--- a/test/lisp/cus-edit-tests.el
+++ b/test/lisp/cus-edit-tests.el
@@ -83,7 +83,14 @@
(ert-deftest test-setopt ()
(should (= (setopt cus-edit-test-foo1 1) 1))
(should (= cus-edit-test-foo1 1))
- (should-error (setopt cus-edit-test-foo1 :foo)))
-
+ (let* ((text-quoting-style 'grave)
+ (warn-txt
+ (with-current-buffer (get-buffer-create "*Warnings*")
+ (let ((inhibit-read-only t))
+ (erase-buffer))
+ (setopt cus-edit-test-foo1 :foo)
+ (buffer-substring-no-properties (point-min) (point-max)))))
+ (should (string-search "Value `:foo' does not match type number"
+ warn-txt))))
(provide 'cus-edit-tests)
;;; cus-edit-tests.el ends here
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
diff --git a/test/lisp/repeat-tests.el b/test/lisp/repeat-tests.el
index 1382d003599..06c6f748a2a 100644
--- a/test/lisp/repeat-tests.el
+++ b/test/lisp/repeat-tests.el
@@ -76,27 +76,27 @@
"C-x w a b a c"
'((1 a) (1 b) (1 a)) "c")
(repeat-tests--check
- "M-C-a b a c"
+ "C-M-a b a c"
'((1 a) (1 b) (1 a)) "c")
(repeat-tests--check
- "M-C-z b a c"
+ "C-M-z b a c"
'((1 a)) "bac")
(unwind-protect
(progn
(put 'repeat-tests-call-a 'repeat-check-key 'no)
(repeat-tests--check
- "M-C-z b a c"
+ "C-M-z b a c"
'((1 a) (1 b) (1 a)) "c"))
(put 'repeat-tests-call-a 'repeat-check-key nil)))
(let ((repeat-check-key nil))
(repeat-tests--check
- "M-C-z b a c"
+ "C-M-z b a c"
'((1 a) (1 b) (1 a)) "c")
(unwind-protect
(progn
(put 'repeat-tests-call-a 'repeat-check-key t)
(repeat-tests--check
- "M-C-z b a c"
+ "C-M-z b a c"
'((1 a)) "bac"))
(put 'repeat-tests-call-a 'repeat-check-key nil))))))
@@ -125,15 +125,17 @@
(repeat-tests--check
"C-2 C-x w a C-3 c"
'((2 a)) "ccc"))
- ;; TODO: fix and uncomment
- ;; (let ((repeat-keep-prefix t))
- ;; (repeat-tests--check
- ;; "C-2 C-x w a b a b c"
- ;; '((2 a) (2 b) (2 a) (2 b)) "c")
- ;; (repeat-tests--check
- ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c"
- ;; '((2 a) (12 b) (12 a) (34 b)) "c"))
- )))
+ ;; Fixed in bug#51281 and bug#55986
+ (let ((repeat-keep-prefix t))
+ ;; Re-enable to take effect.
+ (repeat-mode -1) (repeat-mode +1)
+ (repeat-tests--check
+ "C-2 C-x w a b a b c"
+ '((2 a) (2 b) (2 a) (2 b)) "c")
+ ;; (repeat-tests--check
+ ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c"
+ ;; '((2 a) (12 b) (12 a) (34 b)) "c")
+ ))))
;; TODO: :tags '(:expensive-test) for repeat-exit-timeout
diff --git a/test/lisp/whitespace-tests.el b/test/lisp/whitespace-tests.el
index fb53543c9e1..3e94d7e921b 100644
--- a/test/lisp/whitespace-tests.el
+++ b/test/lisp/whitespace-tests.el
@@ -327,6 +327,16 @@ buffer's content."
"«:whitespace-empty:\n"
"»")))))
+(ert-deftest whitespace-tests--empty-bob-eob-modified ()
+ "Regression test for Bug#60066."
+ (whitespace-tests--with-test-buffer '()
+ (insert "\nx\n\n")
+ (goto-char 2)
+ (set-buffer-modified-p nil)
+ (let ((whitespace-style '(face empty)))
+ (whitespace-mode 1)
+ (should (not (buffer-modified-p))))))
+
(provide 'whitespace-tests)
;;; whitespace-tests.el ends here