diff options
| author | Glenn Morris | 2019-06-01 12:04:42 -0700 |
|---|---|---|
| committer | Glenn Morris | 2019-06-01 12:04:42 -0700 |
| commit | 7e911d007d25df9a483eaad54956a4273405574e (patch) | |
| tree | ce1e4b0eda6c940634922e71a726b5c8aa5270b4 /test | |
| parent | f17e0e93bd8dbe3b069029585dc5d2dda57c1e1e (diff) | |
| parent | 134edc10367a8434167656e631865c85b5f10c42 (diff) | |
| download | emacs-7e911d007d25df9a483eaad54956a4273405574e.tar.gz emacs-7e911d007d25df9a483eaad54956a4273405574e.zip | |
Merge from origin/emacs-26
134edc1 Warn about wrong number of args for subrs (Bug#35767)
5f01af6 Use plain symbols for eieio type descriptors (Bug#29220)
4b24b01 Pacify GCC 9 -Wredundant-decls
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 14 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el | 28 |
2 files changed, 36 insertions, 6 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index ed100020def..f45c9209c14 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -456,6 +456,20 @@ Subtests signal errors if something goes wrong." | |||
| 456 | ;; Should not warn that mt--test2 is not known to be defined. | 456 | ;; Should not warn that mt--test2 is not known to be defined. |
| 457 | (should-not (re-search-forward "my--test2" nil t)))) | 457 | (should-not (re-search-forward "my--test2" nil t)))) |
| 458 | 458 | ||
| 459 | (ert-deftest bytecomp-warn-wrong-args () | ||
| 460 | (with-current-buffer (get-buffer-create "*Compile-Log*") | ||
| 461 | (let ((inhibit-read-only t)) (erase-buffer)) | ||
| 462 | (byte-compile '(remq 1 2 3)) | ||
| 463 | (ert-info ((buffer-string) :prefix "buffer: ") | ||
| 464 | (should (re-search-forward "remq.*3.*2"))))) | ||
| 465 | |||
| 466 | (ert-deftest bytecomp-warn-wrong-args-subr () | ||
| 467 | (with-current-buffer (get-buffer-create "*Compile-Log*") | ||
| 468 | (let ((inhibit-read-only t)) (erase-buffer)) | ||
| 469 | (byte-compile '(safe-length 1 2 3)) | ||
| 470 | (ert-info ((buffer-string) :prefix "buffer: ") | ||
| 471 | (should (re-search-forward "safe-length.*3.*1"))))) | ||
| 472 | |||
| 459 | (ert-deftest test-eager-load-macro-expansion () | 473 | (ert-deftest test-eager-load-macro-expansion () |
| 460 | (test-byte-comp-compile-and-load nil | 474 | (test-byte-comp-compile-and-load nil |
| 461 | '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) | 475 | '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) |
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el index e89d6bb5ec0..b105249c7c5 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el | |||
| @@ -274,7 +274,7 @@ persistent class.") | |||
| 274 | :type vector | 274 | :type vector |
| 275 | :initarg :random-vector))) | 275 | :initarg :random-vector))) |
| 276 | 276 | ||
| 277 | (ert-deftest eieio-test-persist-hash-and-vector () | 277 | (defun eieio-test-persist-hash-and-vector () |
| 278 | (let* ((jane (make-instance 'person :name "Jane")) | 278 | (let* ((jane (make-instance 'person :name "Jane")) |
| 279 | (bob (make-instance 'person :name "Bob")) | 279 | (bob (make-instance 'person :name "Bob")) |
| 280 | (hans (make-instance 'person :name "Hans")) | 280 | (hans (make-instance 'person :name "Hans")) |
| @@ -294,10 +294,18 @@ persistent class.") | |||
| 294 | (aset (car (slot-value class 'janitors)) 1 hans) | 294 | (aset (car (slot-value class 'janitors)) 1 hans) |
| 295 | (aset (nth 1 (slot-value class 'janitors)) 1 dierdre) | 295 | (aset (nth 1 (slot-value class 'janitors)) 1 dierdre) |
| 296 | (unwind-protect | 296 | (unwind-protect |
| 297 | ;; FIXME: This should not error. | 297 | (persist-test-save-and-compare class) |
| 298 | (should-error (persist-test-save-and-compare class)) | ||
| 299 | (delete-file (oref class file))))) | 298 | (delete-file (oref class file))))) |
| 300 | 299 | ||
| 300 | (ert-deftest eieio-persist-hash-and-vector-backward-compatibility () | ||
| 301 | (let ((eieio-backward-compatibility t)) ; The default. | ||
| 302 | (eieio-test-persist-hash-and-vector))) | ||
| 303 | |||
| 304 | (ert-deftest eieio-persist-hash-and-vector-no-backward-compatibility () | ||
| 305 | :expected-result :failed ;; Bug#29220. | ||
| 306 | (let ((eieio-backward-compatibility nil)) | ||
| 307 | (eieio-test-persist-hash-and-vector))) | ||
| 308 | |||
| 301 | ;; Extra quotation of lists inside other objects (Gnus registry), also | 309 | ;; Extra quotation of lists inside other objects (Gnus registry), also |
| 302 | ;; bug#29220. | 310 | ;; bug#29220. |
| 303 | 311 | ||
| @@ -312,7 +320,7 @@ persistent class.") | |||
| 312 | :initarg :htab | 320 | :initarg :htab |
| 313 | :type hash-table))) | 321 | :type hash-table))) |
| 314 | 322 | ||
| 315 | (ert-deftest eieio-test-persist-interior-lists () | 323 | (defun eieio-test-persist-interior-lists () |
| 316 | (let* ((thing (make-instance | 324 | (let* ((thing (make-instance |
| 317 | 'eieio-container | 325 | 'eieio-container |
| 318 | :vec [nil] | 326 | :vec [nil] |
| @@ -332,8 +340,16 @@ persistent class.") | |||
| 332 | (setf (nth 2 (cadar alst)) john | 340 | (setf (nth 2 (cadar alst)) john |
| 333 | (nth 2 (cadadr alst)) alexie) | 341 | (nth 2 (cadadr alst)) alexie) |
| 334 | (unwind-protect | 342 | (unwind-protect |
| 335 | ;; FIXME: Should not error. | 343 | (persist-test-save-and-compare thing) |
| 336 | (should-error (persist-test-save-and-compare thing)) | ||
| 337 | (delete-file (slot-value thing 'file))))) | 344 | (delete-file (slot-value thing 'file))))) |
| 338 | 345 | ||
| 346 | (ert-deftest eieio-test-persist-interior-lists-backward-compatibility () | ||
| 347 | (let ((eieio-backward-compatibility t)) ; The default. | ||
| 348 | (eieio-test-persist-interior-lists))) | ||
| 349 | |||
| 350 | (ert-deftest eieio-test-persist-interior-lists-no-backward-compatibility () | ||
| 351 | :expected-result :failed ;; Bug#29220. | ||
| 352 | (let ((eieio-backward-compatibility nil)) | ||
| 353 | (eieio-test-persist-interior-lists))) | ||
| 354 | |||
| 339 | ;;; eieio-test-persist.el ends here | 355 | ;;; eieio-test-persist.el ends here |