diff options
author | Glenn Morris <rgm@gnu.org> | 2020-06-07 09:03:59 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2020-06-07 09:03:59 -0700 |
commit | fa6d56529f9ebaedaf62ecbf8887ffecca7dce12 (patch) | |
tree | 922e12ffbf813534647a96788b9a5fb77b4f2288 /test/lisp | |
parent | 6cb557e7a58d7f1c2e9afceeba45d0ced2aff214 (diff) | |
parent | 35661ef943d261f6c43e93e475ddd8516f4a4b62 (diff) | |
download | emacs-fa6d56529f9ebaedaf62ecbf8887ffecca7dce12.tar.gz emacs-fa6d56529f9ebaedaf62ecbf8887ffecca7dce12.tar.bz2 emacs-fa6d56529f9ebaedaf62ecbf8887ffecca7dce12.zip |
Merge from origin/emacs-27
35661ef943 (origin/emacs-27) Fix typo in "(elisp) Type Keywords"
1af0e95fec Gnus nnir-summary-line-format has no effect
dd366b5d3b Improve documentation of 'window-text-pixel-size'
fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix. (Bug#41...
d8593fd19f Minor improvements to EDE and EIEIO manuals
3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options
cc35b197c7 Update package-menu-quick-help
bf09106256 Improve documentation of 'sort-subr'
73749efa13 Update Ukrainian transliteration
30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered
7d323f07c0 Silence some byte-compiler warnings in tests
cf473e742f * test/lisp/battery-tests.el: New file.
b07e3b1d97 Improve format-spec documentation (bug#41571)
# Conflicts:
# test/lisp/emacs-lisp/package-tests.el
Diffstat (limited to 'test/lisp')
-rw-r--r-- | test/lisp/battery-tests.el | 58 | ||||
-rw-r--r-- | test/lisp/emacs-lisp/cl-generic-tests.el | 8 | ||||
-rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 5 | ||||
-rw-r--r-- | test/lisp/eshell/eshell-tests.el | 1 | ||||
-rw-r--r-- | test/lisp/image/exif-tests.el | 5 | ||||
-rw-r--r-- | test/lisp/international/ccl-tests.el | 3 | ||||
-rw-r--r-- | test/lisp/mail/footnote-tests.el | 6 | ||||
-rw-r--r-- | test/lisp/progmodes/elisp-mode-tests.el | 11 | ||||
-rw-r--r-- | test/lisp/progmodes/sql-tests.el | 2 | ||||
-rw-r--r-- | test/lisp/simple-tests.el | 3 | ||||
-rw-r--r-- | test/lisp/wdired-tests.el | 2 |
11 files changed, 88 insertions, 16 deletions
diff --git a/test/lisp/battery-tests.el b/test/lisp/battery-tests.el new file mode 100644 index 00000000000..052ae49a800 --- /dev/null +++ b/test/lisp/battery-tests.el @@ -0,0 +1,58 @@ +;;; battery-tests.el --- tests for battery.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. + +;;; Code: + +(require 'battery) + +(ert-deftest battery-linux-proc-apm-regexp () + "Test `battery-linux-proc-apm-regexp'." + (let ((str "1.16 1.2 0x07 0x01 0xff 0x80 -1% -1 ?")) + (should (string-match battery-linux-proc-apm-regexp str)) + (should (equal (match-string 0 str) str)) + (should (equal (match-string 1 str) "1.16")) + (should (equal (match-string 2 str) "1.2")) + (should (equal (match-string 3 str) "07")) + (should (equal (match-string 4 str) "01")) + (should (equal (match-string 5 str) "ff")) + (should (equal (match-string 6 str) "80")) + (should (equal (match-string 7 str) "-1")) + (should (equal (match-string 8 str) "-1")) + (should (equal (match-string 9 str) "?"))) + (let ((str "1.16 1.2 0x03 0x00 0x00 0x01 99% 1792 min")) + (should (string-match battery-linux-proc-apm-regexp str)) + (should (equal (match-string 0 str) str)) + (should (equal (match-string 1 str) "1.16")) + (should (equal (match-string 2 str) "1.2")) + (should (equal (match-string 3 str) "03")) + (should (equal (match-string 4 str) "00")) + (should (equal (match-string 5 str) "00")) + (should (equal (match-string 6 str) "01")) + (should (equal (match-string 7 str) "99")) + (should (equal (match-string 8 str) "1792")) + (should (equal (match-string 9 str) "min")))) + +(ert-deftest battery-format () + "Test `battery-format'." + (should (equal (battery-format "" ()) "")) + (should (equal (battery-format "" '((?b . "-"))) "")) + (should (equal (battery-format "%a%b%p%%" '((?b . "-") (?p . "99"))) + "-99%"))) + +;;; battery-tests.el ends here diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el index d9f1cb9ec43..51c9884ddc8 100644 --- a/test/lisp/emacs-lisp/cl-generic-tests.el +++ b/test/lisp/emacs-lisp/cl-generic-tests.el @@ -23,9 +23,15 @@ ;;; Code: -(eval-when-compile (require 'ert)) ;Don't indirectly require cl-lib at run-time. (require 'cl-generic) +;; Don't indirectly require `cl-lib' at run-time. +(eval-when-compile (require 'ert)) +(declare-function ert--should-signal-hook "ert") +(declare-function ert--signal-should-execution "ert") +(declare-function ert-fail "ert") +(declare-function ert-set-test "ert") + (fmakunbound 'cl--generic-1) (cl-defgeneric cl--generic-1 (x y)) (cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 732bf5e061f..90714af3061 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -267,6 +267,9 @@ Must called from within a `tar-mode' buffer." (should (package-installed-p 'simple-single)) (should (package-installed-p 'simple-depend)))) +(declare-function macro-problem-func "macro-problem" ()) +(declare-function macro-problem-10-and-90 "macro-problem" ()) + (ert-deftest package-test-macro-compilation () "Install a package which includes a dependency." (with-package-test (:basedir "package-resources") @@ -616,6 +619,8 @@ Must called from within a `tar-mode' buffer." (let ((process-environment (cons (concat "HOME=" homedir) process-environment))) + (require 'epg-config) + (defvar epg-config--program-alist) (epg-find-configuration 'OpenPGP nil ;; By default we require gpg2 2.1+ due to some diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index ce8d728833d..16a04647723 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -26,6 +26,7 @@ ;;; Code: (require 'ert) +(require 'esh-mode) (require 'eshell) (defmacro with-temp-eshell (&rest body) diff --git a/test/lisp/image/exif-tests.el b/test/lisp/image/exif-tests.el index 8a2231106f0..9e5da46b508 100644 --- a/test/lisp/image/exif-tests.el +++ b/test/lisp/image/exif-tests.el @@ -21,7 +21,6 @@ (require 'ert) (require 'exif) -(require 'seq) (defun test-image-file (name) (expand-file-name @@ -49,7 +48,7 @@ (should (equal (exif-elem exif 'artist) "z")))) (ert-deftest test-exit-direct-ascii-value () - (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)) - (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))) + (should (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0))) + (should (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0)))) ;;; exif-tests.el ends here diff --git a/test/lisp/international/ccl-tests.el b/test/lisp/international/ccl-tests.el index 283b2e1b32b..9277d0162e8 100644 --- a/test/lisp/international/ccl-tests.el +++ b/test/lisp/international/ccl-tests.el @@ -96,6 +96,9 @@ At EOF: (ccl-dump prog-pgg-code) (should (equal (buffer-string) prog-pgg-dump)))) +(defvar pgg-parse-crc24) +(declare-function pgg-parse-crc24-string "pgg-parse" (string)) + (ert-deftest pgg-parse-crc24 () ;; Compiler (require 'pgg) diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el index 458964c306e..79f48072391 100644 --- a/test/lisp/mail/footnote-tests.el +++ b/test/lisp/mail/footnote-tests.el @@ -18,12 +18,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see <https://www.gnu.org/licenses/>. -;;; Commentary: - -;; - ;;; Code: +(require 'footnote) + (ert-deftest footnote-tests-same-place () (with-temp-buffer (footnote-mode 1) diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index b793f7389b4..2ba00656862 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -598,16 +598,17 @@ to (xref-elisp-test-descr-to-target xref)." ;; Define some mode-local overloadable/overridden functions for xref to find (require 'mode-local) +(declare-function xref-elisp-overloadable-no-methods-default "elisp-mode-tests") +(declare-function xref-elisp-overloadable-no-default-default "elisp-mode-tests") + (define-overloadable-function xref-elisp-overloadable-no-methods () "doc string overloadable no-methods") (define-overloadable-function xref-elisp-overloadable-no-default () "doc string overloadable no-default") -;; FIXME: byte compiler complains about unused lexical arguments -;; generated by this macro. (define-mode-local-override xref-elisp-overloadable-no-default c-mode - (start end &optional nonterminal depth returnonerror) + (_start _end &optional _nonterminal _depth _returnonerror) "doc string overloadable no-default c-mode." "result overloadable no-default c-mode.") @@ -616,7 +617,7 @@ to (xref-elisp-test-descr-to-target xref)." "result overloadable co-located-default.") (define-mode-local-override xref-elisp-overloadable-co-located-default c-mode - (start end &optional nonterminal depth returnonerror) + (_start _end &optional _nonterminal _depth _returnonerror) "doc string overloadable co-located-default c-mode." "result overloadable co-located-default c-mode.") @@ -628,7 +629,7 @@ to (xref-elisp-test-descr-to-target xref)." "result overloadable separate-default.") (define-mode-local-override xref-elisp-overloadable-separate-default c-mode - (start end &optional nonterminal depth returnonerror) + (_start _end &optional _nonterminal _depth _returnonerror) "doc string overloadable separate-default c-mode." "result overloadable separate-default c-mode.") diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el index d6f89341bed..65ed76bfb5d 100644 --- a/test/lisp/progmodes/sql-tests.el +++ b/test/lisp/progmodes/sql-tests.el @@ -193,7 +193,7 @@ Perform ACTION and validate results" "Add a product that already exists." (sql-test-product-feature-harness - (should-error (sql-add-feature 'a "Aaa")) + (should-error (sql-add-product 'a "Aaa")) (should (equal (pp-to-string (assoc 'a sql-product-alist)) "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n")))) diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 88be74fd2cc..4adcacb279b 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -758,8 +758,7 @@ See Bug#21722." (defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body) (declare (debug (sexp form body)) (indent 2)) - (let ((expected (make-symbol "expected")) - (command (make-symbol "command")) + (let ((command (make-symbol "command")) (caller-buf (make-symbol "caller-buf")) (output-buf (make-symbol "output-buf"))) `(let* ((,caller-buf (generate-new-buffer "caller-buf")) diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index baa547758ef..5b01c54cf24 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el @@ -129,6 +129,8 @@ wdired-mode." (delete-directory test-dir t))))) (defvar server-socket-dir) +(declare-function dired-smart-shell-command "dired-x" + (command &optional output-buffer error-buffer)) (ert-deftest wdired-test-bug34915 () "Test editing when dired-listing-switches includes -F. |