1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merge from origin/emacs-29

d3a76db88b * lisp/repeat.el: Fix repeat-keep-prefix to allow customi...
8ef3777d54 Correct capitalization of Lisp in the manual (bug#60222)
d03ea89378 eglot.el: Add vscode-json-languageserver to eglot-server-...
8550a99378 ; * src/emacs-module.h.in (enum emacs_funcall_exit): Fix ...
fb7f3999c5 ; Fix ruby-method-params-indent's :version value
cfbfd393b4 * lisp/progmodes/project.el (project--read-file-cpd-relat...
2b1fdbffcb ruby-method-params-indent: New user option
b9e813f79f ; ruby-indent-level: Improve the docstring
399433cc2b * lisp/progmodes/project.el: Filter out empty strings fro...
23f7c9c2a9 Fix storing email into nnmail by Gnus
63cdbd986b ; Really respect browse-url var in erc-compat
64163618d2 whitespace: Fix unintended change in buffer modification ...
a75d1da911 Make emacsclient add abbreviated file names to file-name-...
b3e7768a0e Repair setopt test after error demotion to warning
This commit is contained in:
Stefan Kangas 2022-12-21 02:37:17 +01:00
commit 2bbc554db6
18 changed files with 211 additions and 102 deletions

View file

@ -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

View file

@ -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:

View file

@ -538,3 +538,7 @@ class Bar
baz
end
end
# Local Variables:
# ruby-method-params-indent: t
# End:

View file

@ -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

View file

@ -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

View file

@ -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