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

* test/: Use lexical-binding the few remaining files

* test/manual/biditest.el: Use lexical-binding.
(biditest-generate-testfile): Remove unused var `levels`.

* test/manual/image-circular-tests.el: Use lexical-binding.

* test/manual/image-size-tests.el: Use lexical-binding.
(image-size-tests): Check `fboundp` before calling `imagemagick-types`.

* test/manual/redisplay-testsuite.el: Use lexical-binding.

* test/manual/cedet/cedet-utests.el: Use lexical-binding.
Use `with-current-buffer`.
(cedet-utest): Test `fboundp` i.s.o `featurep` to silence warning.
(srecode-map-save-file): Declare var.
(pulse-test): Test `fboundp` before calling `pulse-available-p`.
Declare `pulse-momentary-highlight-overlay` since it's not autoloaded.

* test/manual/cedet/semantic-tests.el: Use lexical-binding.
Use `with-current-buffer`.
(semanticdb-ebrowse-dump): Remove unused var `ab`.
(semanticdb-test-gnu-global): Don't use obsolete "name" arg to constructor.
(cedet-utest-directory): Declare var.
This commit is contained in:
Stefan Monnier 2021-02-23 12:14:59 -05:00
parent a283996fc7
commit 07235678a4
6 changed files with 42 additions and 37 deletions

View file

@ -1,4 +1,4 @@
;;; semantic-utest.el --- Miscellaneous Semantic tests.
;;; semantic-utest.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*-
;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
@ -64,10 +64,12 @@ run the test again")))
"Find the first loaded ebrowse table, and dump out the contents."
(interactive)
(let ((db semanticdb-database-list)
(ab nil))
;; (ab nil)
)
(while db
(when (semanticdb-project-database-ebrowse-p (car db))
(setq ab (data-debug-new-buffer "*EBROWSE Database*"))
;; (setq ab
(data-debug-new-buffer "*EBROWSE Database*") ;;)
(data-debug-insert-thing (car db) "*" "")
(setq db nil)
)
@ -100,7 +102,7 @@ If optional arg STANDARDFILE is non-nil, use a standard file w/ global enabled."
(set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile)))
(semanticdb-enable-gnu-global-in-buffer))))
(let* ((db (semanticdb-project-database-global "global"))
(let* ((db (semanticdb-project-database-global)) ;; "global"
(tab (semanticdb-file-table db (buffer-file-name)))
(result (semanticdb-deep-find-tags-for-completion-method tab searchfor))
)
@ -127,8 +129,7 @@ Optional argument ARG specifies not to use color."
(princ (car fns))
(princ ":\n ")
(let ((s (funcall (car fns) tag par (not arg))))
(save-excursion
(set-buffer "*format-tag*")
(with-current-buffer "*format-tag*"
(goto-char (point-max))
(insert s)))
(setq fns (cdr fns))))
@ -163,7 +164,7 @@ Optional argument ARG specifies not to use color."
"Test `semantic-idle-scheduler-work-parse-neighboring-files' and time it."
(interactive)
(let ((start (current-time))
(junk (semantic-idle-scheduler-work-parse-neighboring-files)))
(_junk (semantic-idle-scheduler-work-parse-neighboring-files)))
(message "Work took %.2f seconds." (semantic-elapsed-time start nil))))
;;; From semantic-lex:
@ -210,6 +211,8 @@ Analyze the area between BEG and END."
(semantic-lex-spp-table-write-slot-value
(semantic-lex-spp-save-table))))
(defvar cedet-utest-directory) ;From test/manual/cedet/cedet-utests.el?
(defun semantic-lex-spp-write-utest ()
"Unit test using the test spp file to test the slot write fcn."
(interactive)
@ -258,7 +261,7 @@ tag that contains point, and return that."
(Lcount 0))
(when (semantic-tag-p target)
(semantic-symref-hits-in-region
target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
target (lambda (_start _end _prefix) (setq Lcount (1+ Lcount)))
(semantic-tag-start tag)
(semantic-tag-end tag))
(when (called-interactively-p 'interactive)