diff options
| author | Stefan Kangas | 2022-12-21 02:37:17 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2022-12-21 02:37:17 +0100 |
| commit | 2bbc554db63cc5cc140ade5bfcbbf53ecd18f5ae (patch) | |
| tree | 044d6aa99d0ef54ace6c01583231c1ae286c8865 /test | |
| parent | 1424342225ef5b18c630364dd88e004f4ebb1c7f (diff) | |
| parent | d3a76db88b4357fe1c92f240796ea9b522b97a8e (diff) | |
| download | emacs-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')
| -rw-r--r-- | test/lisp/cus-edit-tests.el | 11 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb | 18 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-mode-resources/ruby.rb | 4 | ||||
| -rw-r--r-- | test/lisp/progmodes/ruby-mode-tests.el | 24 | ||||
| -rw-r--r-- | test/lisp/repeat-tests.el | 30 | ||||
| -rw-r--r-- | test/lisp/whitespace-tests.el | 10 |
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 @@ | |||
| 83 | (ert-deftest test-setopt () | 83 | (ert-deftest test-setopt () |
| 84 | (should (= (setopt cus-edit-test-foo1 1) 1)) | 84 | (should (= (setopt cus-edit-test-foo1 1) 1)) |
| 85 | (should (= cus-edit-test-foo1 1)) | 85 | (should (= cus-edit-test-foo1 1)) |
| 86 | (should-error (setopt cus-edit-test-foo1 :foo))) | 86 | (let* ((text-quoting-style 'grave) |
| 87 | 87 | (warn-txt | |
| 88 | (with-current-buffer (get-buffer-create "*Warnings*") | ||
| 89 | (let ((inhibit-read-only t)) | ||
| 90 | (erase-buffer)) | ||
| 91 | (setopt cus-edit-test-foo1 :foo) | ||
| 92 | (buffer-substring-no-properties (point-min) (point-max))))) | ||
| 93 | (should (string-search "Value `:foo' does not match type number" | ||
| 94 | warn-txt)))) | ||
| 88 | (provide 'cus-edit-tests) | 95 | (provide 'cus-edit-tests) |
| 89 | ;;; cus-edit-tests.el ends here | 96 | ;;; 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 @@ | |||
| 1 | class 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 | ||
| 14 | end | ||
| 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 |
| 540 | end | 540 | end |
| 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 |
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 @@ | |||
| 76 | "C-x w a b a c" | 76 | "C-x w a b a c" |
| 77 | '((1 a) (1 b) (1 a)) "c") | 77 | '((1 a) (1 b) (1 a)) "c") |
| 78 | (repeat-tests--check | 78 | (repeat-tests--check |
| 79 | "M-C-a b a c" | 79 | "C-M-a b a c" |
| 80 | '((1 a) (1 b) (1 a)) "c") | 80 | '((1 a) (1 b) (1 a)) "c") |
| 81 | (repeat-tests--check | 81 | (repeat-tests--check |
| 82 | "M-C-z b a c" | 82 | "C-M-z b a c" |
| 83 | '((1 a)) "bac") | 83 | '((1 a)) "bac") |
| 84 | (unwind-protect | 84 | (unwind-protect |
| 85 | (progn | 85 | (progn |
| 86 | (put 'repeat-tests-call-a 'repeat-check-key 'no) | 86 | (put 'repeat-tests-call-a 'repeat-check-key 'no) |
| 87 | (repeat-tests--check | 87 | (repeat-tests--check |
| 88 | "M-C-z b a c" | 88 | "C-M-z b a c" |
| 89 | '((1 a) (1 b) (1 a)) "c")) | 89 | '((1 a) (1 b) (1 a)) "c")) |
| 90 | (put 'repeat-tests-call-a 'repeat-check-key nil))) | 90 | (put 'repeat-tests-call-a 'repeat-check-key nil))) |
| 91 | (let ((repeat-check-key nil)) | 91 | (let ((repeat-check-key nil)) |
| 92 | (repeat-tests--check | 92 | (repeat-tests--check |
| 93 | "M-C-z b a c" | 93 | "C-M-z b a c" |
| 94 | '((1 a) (1 b) (1 a)) "c") | 94 | '((1 a) (1 b) (1 a)) "c") |
| 95 | (unwind-protect | 95 | (unwind-protect |
| 96 | (progn | 96 | (progn |
| 97 | (put 'repeat-tests-call-a 'repeat-check-key t) | 97 | (put 'repeat-tests-call-a 'repeat-check-key t) |
| 98 | (repeat-tests--check | 98 | (repeat-tests--check |
| 99 | "M-C-z b a c" | 99 | "C-M-z b a c" |
| 100 | '((1 a)) "bac")) | 100 | '((1 a)) "bac")) |
| 101 | (put 'repeat-tests-call-a 'repeat-check-key nil)))))) | 101 | (put 'repeat-tests-call-a 'repeat-check-key nil)))))) |
| 102 | 102 | ||
| @@ -125,15 +125,17 @@ | |||
| 125 | (repeat-tests--check | 125 | (repeat-tests--check |
| 126 | "C-2 C-x w a C-3 c" | 126 | "C-2 C-x w a C-3 c" |
| 127 | '((2 a)) "ccc")) | 127 | '((2 a)) "ccc")) |
| 128 | ;; TODO: fix and uncomment | 128 | ;; Fixed in bug#51281 and bug#55986 |
| 129 | ;; (let ((repeat-keep-prefix t)) | 129 | (let ((repeat-keep-prefix t)) |
| 130 | ;; (repeat-tests--check | 130 | ;; Re-enable to take effect. |
| 131 | ;; "C-2 C-x w a b a b c" | 131 | (repeat-mode -1) (repeat-mode +1) |
| 132 | ;; '((2 a) (2 b) (2 a) (2 b)) "c") | 132 | (repeat-tests--check |
| 133 | ;; (repeat-tests--check | 133 | "C-2 C-x w a b a b c" |
| 134 | ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c" | 134 | '((2 a) (2 b) (2 a) (2 b)) "c") |
| 135 | ;; '((2 a) (12 b) (12 a) (34 b)) "c")) | 135 | ;; (repeat-tests--check |
| 136 | ))) | 136 | ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c" |
| 137 | ;; '((2 a) (12 b) (12 a) (34 b)) "c") | ||
| 138 | )))) | ||
| 137 | 139 | ||
| 138 | ;; TODO: :tags '(:expensive-test) for repeat-exit-timeout | 140 | ;; TODO: :tags '(:expensive-test) for repeat-exit-timeout |
| 139 | 141 | ||
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." | |||
| 327 | "«:whitespace-empty:\n" | 327 | "«:whitespace-empty:\n" |
| 328 | "»"))))) | 328 | "»"))))) |
| 329 | 329 | ||
| 330 | (ert-deftest whitespace-tests--empty-bob-eob-modified () | ||
| 331 | "Regression test for Bug#60066." | ||
| 332 | (whitespace-tests--with-test-buffer '() | ||
| 333 | (insert "\nx\n\n") | ||
| 334 | (goto-char 2) | ||
| 335 | (set-buffer-modified-p nil) | ||
| 336 | (let ((whitespace-style '(face empty))) | ||
| 337 | (whitespace-mode 1) | ||
| 338 | (should (not (buffer-modified-p)))))) | ||
| 339 | |||
| 330 | (provide 'whitespace-tests) | 340 | (provide 'whitespace-tests) |
| 331 | 341 | ||
| 332 | ;;; whitespace-tests.el ends here | 342 | ;;; whitespace-tests.el ends here |