aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris2020-06-07 09:03:59 -0700
committerGlenn Morris2020-06-07 09:03:59 -0700
commitfa6d56529f9ebaedaf62ecbf8887ffecca7dce12 (patch)
tree922e12ffbf813534647a96788b9a5fb77b4f2288 /test
parent6cb557e7a58d7f1c2e9afceeba45d0ced2aff214 (diff)
parent35661ef943d261f6c43e93e475ddd8516f4a4b62 (diff)
downloademacs-fa6d56529f9ebaedaf62ecbf8887ffecca7dce12.tar.gz
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')
-rw-r--r--test/lisp/battery-tests.el58
-rw-r--r--test/lisp/emacs-lisp/cl-generic-tests.el8
-rw-r--r--test/lisp/emacs-lisp/package-tests.el5
-rw-r--r--test/lisp/eshell/eshell-tests.el1
-rw-r--r--test/lisp/image/exif-tests.el5
-rw-r--r--test/lisp/international/ccl-tests.el3
-rw-r--r--test/lisp/mail/footnote-tests.el6
-rw-r--r--test/lisp/progmodes/elisp-mode-tests.el11
-rw-r--r--test/lisp/progmodes/sql-tests.el2
-rw-r--r--test/lisp/simple-tests.el3
-rw-r--r--test/lisp/wdired-tests.el2
-rw-r--r--test/src/buffer-tests.el1
-rw-r--r--test/src/data-tests.el6
13 files changed, 92 insertions, 19 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 @@
1;;; battery-tests.el --- tests for battery.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'battery)
23
24(ert-deftest battery-linux-proc-apm-regexp ()
25 "Test `battery-linux-proc-apm-regexp'."
26 (let ((str "1.16 1.2 0x07 0x01 0xff 0x80 -1% -1 ?"))
27 (should (string-match battery-linux-proc-apm-regexp str))
28 (should (equal (match-string 0 str) str))
29 (should (equal (match-string 1 str) "1.16"))
30 (should (equal (match-string 2 str) "1.2"))
31 (should (equal (match-string 3 str) "07"))
32 (should (equal (match-string 4 str) "01"))
33 (should (equal (match-string 5 str) "ff"))
34 (should (equal (match-string 6 str) "80"))
35 (should (equal (match-string 7 str) "-1"))
36 (should (equal (match-string 8 str) "-1"))
37 (should (equal (match-string 9 str) "?")))
38 (let ((str "1.16 1.2 0x03 0x00 0x00 0x01 99% 1792 min"))
39 (should (string-match battery-linux-proc-apm-regexp str))
40 (should (equal (match-string 0 str) str))
41 (should (equal (match-string 1 str) "1.16"))
42 (should (equal (match-string 2 str) "1.2"))
43 (should (equal (match-string 3 str) "03"))
44 (should (equal (match-string 4 str) "00"))
45 (should (equal (match-string 5 str) "00"))
46 (should (equal (match-string 6 str) "01"))
47 (should (equal (match-string 7 str) "99"))
48 (should (equal (match-string 8 str) "1792"))
49 (should (equal (match-string 9 str) "min"))))
50
51(ert-deftest battery-format ()
52 "Test `battery-format'."
53 (should (equal (battery-format "" ()) ""))
54 (should (equal (battery-format "" '((?b . "-"))) ""))
55 (should (equal (battery-format "%a%b%p%%" '((?b . "-") (?p . "99")))
56 "-99%")))
57
58;;; 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 @@
23 23
24;;; Code: 24;;; Code:
25 25
26(eval-when-compile (require 'ert)) ;Don't indirectly require cl-lib at run-time.
27(require 'cl-generic) 26(require 'cl-generic)
28 27
28;; Don't indirectly require `cl-lib' at run-time.
29(eval-when-compile (require 'ert))
30(declare-function ert--should-signal-hook "ert")
31(declare-function ert--signal-should-execution "ert")
32(declare-function ert-fail "ert")
33(declare-function ert-set-test "ert")
34
29(fmakunbound 'cl--generic-1) 35(fmakunbound 'cl--generic-1)
30(cl-defgeneric cl--generic-1 (x y)) 36(cl-defgeneric cl--generic-1 (x y))
31(cl-defgeneric (setf cl--generic-1) (v y z) "My generic doc.") 37(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."
267 (should (package-installed-p 'simple-single)) 267 (should (package-installed-p 'simple-single))
268 (should (package-installed-p 'simple-depend)))) 268 (should (package-installed-p 'simple-depend))))
269 269
270(declare-function macro-problem-func "macro-problem" ())
271(declare-function macro-problem-10-and-90 "macro-problem" ())
272
270(ert-deftest package-test-macro-compilation () 273(ert-deftest package-test-macro-compilation ()
271 "Install a package which includes a dependency." 274 "Install a package which includes a dependency."
272 (with-package-test (:basedir "package-resources") 275 (with-package-test (:basedir "package-resources")
@@ -616,6 +619,8 @@ Must called from within a `tar-mode' buffer."
616 (let ((process-environment 619 (let ((process-environment
617 (cons (concat "HOME=" homedir) 620 (cons (concat "HOME=" homedir)
618 process-environment))) 621 process-environment)))
622 (require 'epg-config)
623 (defvar epg-config--program-alist)
619 (epg-find-configuration 624 (epg-find-configuration
620 'OpenPGP nil 625 'OpenPGP nil
621 ;; By default we require gpg2 2.1+ due to some 626 ;; 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 @@
26;;; Code: 26;;; Code:
27 27
28(require 'ert) 28(require 'ert)
29(require 'esh-mode)
29(require 'eshell) 30(require 'eshell)
30 31
31(defmacro with-temp-eshell (&rest body) 32(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 @@
21 21
22(require 'ert) 22(require 'ert)
23(require 'exif) 23(require 'exif)
24(require 'seq)
25 24
26(defun test-image-file (name) 25(defun test-image-file (name)
27 (expand-file-name 26 (expand-file-name
@@ -49,7 +48,7 @@
49 (should (equal (exif-elem exif 'artist) "z")))) 48 (should (equal (exif-elem exif 'artist) "z"))))
50 49
51(ert-deftest test-exit-direct-ascii-value () 50(ert-deftest test-exit-direct-ascii-value ()
52 (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)) 51 (should (equal (exif--direct-ascii-value 28005 2 t) (string ?e ?m 0)))
53 (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))) 52 (should (equal (exif--direct-ascii-value 28005 2 nil) (string ?m ?e 0))))
54 53
55;;; exif-tests.el ends here 54;;; 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:
96 (ccl-dump prog-pgg-code) 96 (ccl-dump prog-pgg-code)
97 (should (equal (buffer-string) prog-pgg-dump)))) 97 (should (equal (buffer-string) prog-pgg-dump))))
98 98
99(defvar pgg-parse-crc24)
100(declare-function pgg-parse-crc24-string "pgg-parse" (string))
101
99(ert-deftest pgg-parse-crc24 () 102(ert-deftest pgg-parse-crc24 ()
100 ;; Compiler 103 ;; Compiler
101 (require 'pgg) 104 (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 @@
18;; You should have received a copy of the GNU General Public License 18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>. 19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20 20
21;;; Commentary:
22
23;;
24
25;;; Code: 21;;; Code:
26 22
23(require 'footnote)
24
27(ert-deftest footnote-tests-same-place () 25(ert-deftest footnote-tests-same-place ()
28 (with-temp-buffer 26 (with-temp-buffer
29 (footnote-mode 1) 27 (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)."
598;; Define some mode-local overloadable/overridden functions for xref to find 598;; Define some mode-local overloadable/overridden functions for xref to find
599(require 'mode-local) 599(require 'mode-local)
600 600
601(declare-function xref-elisp-overloadable-no-methods-default "elisp-mode-tests")
602(declare-function xref-elisp-overloadable-no-default-default "elisp-mode-tests")
603
601(define-overloadable-function xref-elisp-overloadable-no-methods () 604(define-overloadable-function xref-elisp-overloadable-no-methods ()
602 "doc string overloadable no-methods") 605 "doc string overloadable no-methods")
603 606
604(define-overloadable-function xref-elisp-overloadable-no-default () 607(define-overloadable-function xref-elisp-overloadable-no-default ()
605 "doc string overloadable no-default") 608 "doc string overloadable no-default")
606 609
607;; FIXME: byte compiler complains about unused lexical arguments
608;; generated by this macro.
609(define-mode-local-override xref-elisp-overloadable-no-default c-mode 610(define-mode-local-override xref-elisp-overloadable-no-default c-mode
610 (start end &optional nonterminal depth returnonerror) 611 (_start _end &optional _nonterminal _depth _returnonerror)
611 "doc string overloadable no-default c-mode." 612 "doc string overloadable no-default c-mode."
612 "result overloadable no-default c-mode.") 613 "result overloadable no-default c-mode.")
613 614
@@ -616,7 +617,7 @@ to (xref-elisp-test-descr-to-target xref)."
616 "result overloadable co-located-default.") 617 "result overloadable co-located-default.")
617 618
618(define-mode-local-override xref-elisp-overloadable-co-located-default c-mode 619(define-mode-local-override xref-elisp-overloadable-co-located-default c-mode
619 (start end &optional nonterminal depth returnonerror) 620 (_start _end &optional _nonterminal _depth _returnonerror)
620 "doc string overloadable co-located-default c-mode." 621 "doc string overloadable co-located-default c-mode."
621 "result overloadable co-located-default c-mode.") 622 "result overloadable co-located-default c-mode.")
622 623
@@ -628,7 +629,7 @@ to (xref-elisp-test-descr-to-target xref)."
628 "result overloadable separate-default.") 629 "result overloadable separate-default.")
629 630
630(define-mode-local-override xref-elisp-overloadable-separate-default c-mode 631(define-mode-local-override xref-elisp-overloadable-separate-default c-mode
631 (start end &optional nonterminal depth returnonerror) 632 (_start _end &optional _nonterminal _depth _returnonerror)
632 "doc string overloadable separate-default c-mode." 633 "doc string overloadable separate-default c-mode."
633 "result overloadable separate-default c-mode.") 634 "result overloadable separate-default c-mode.")
634 635
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"
193 "Add a product that already exists." 193 "Add a product that already exists."
194 194
195 (sql-test-product-feature-harness 195 (sql-test-product-feature-harness
196 (should-error (sql-add-feature 'a "Aaa")) 196 (should-error (sql-add-product 'a "Aaa"))
197 (should (equal (pp-to-string (assoc 'a sql-product-alist)) 197 (should (equal (pp-to-string (assoc 'a sql-product-alist))
198 "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n")))) 198 "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n"))))
199 199
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."
758 758
759(defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body) 759(defmacro with-shell-command-dont-erase-buffer (str output-buffer-is-current &rest body)
760 (declare (debug (sexp form body)) (indent 2)) 760 (declare (debug (sexp form body)) (indent 2))
761 (let ((expected (make-symbol "expected")) 761 (let ((command (make-symbol "command"))
762 (command (make-symbol "command"))
763 (caller-buf (make-symbol "caller-buf")) 762 (caller-buf (make-symbol "caller-buf"))
764 (output-buf (make-symbol "output-buf"))) 763 (output-buf (make-symbol "output-buf")))
765 `(let* ((,caller-buf (generate-new-buffer "caller-buf")) 764 `(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."
129 (delete-directory test-dir t))))) 129 (delete-directory test-dir t)))))
130 130
131(defvar server-socket-dir) 131(defvar server-socket-dir)
132(declare-function dired-smart-shell-command "dired-x"
133 (command &optional output-buffer error-buffer))
132 134
133(ert-deftest wdired-test-bug34915 () 135(ert-deftest wdired-test-bug34915 ()
134 "Test editing when dired-listing-switches includes -F. 136 "Test editing when dired-listing-switches includes -F.
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 6e9764625a9..0db66f97517 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -20,6 +20,7 @@
20;;; Code: 20;;; Code:
21 21
22(require 'ert) 22(require 'ert)
23(require 'seq)
23(eval-when-compile (require 'cl-lib)) 24(eval-when-compile (require 'cl-lib))
24 25
25(ert-deftest overlay-modification-hooks-message-other-buf () 26(ert-deftest overlay-modification-hooks-message-other-buf ()
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 3cebb3dfa57..ed092039078 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -174,7 +174,7 @@ most-positive-fixnum, which is just less than a power of 2.")
174 sum 1)) 174 sum 1))
175 175
176(defun test-bool-vector-bv-from-hex-string (desc) 176(defun test-bool-vector-bv-from-hex-string (desc)
177 (let (bv nchars nibbles) 177 (let (bv nibbles)
178 (dolist (c (string-to-list desc)) 178 (dolist (c (string-to-list desc))
179 (push (string-to-number 179 (push (string-to-number
180 (char-to-string c) 180 (char-to-string c)
@@ -244,9 +244,9 @@ comparing the subr with a much slower lisp implementation."
244 244
245(defun test-bool-vector-apply-mock-op (mock a b c) 245(defun test-bool-vector-apply-mock-op (mock a b c)
246 "Compute (slowly) the correct result of a bool-vector set operation." 246 "Compute (slowly) the correct result of a bool-vector set operation."
247 (let (changed nv) 247 (let (changed)
248 (cl-assert (eql (length b) (length c))) 248 (cl-assert (eql (length b) (length c)))
249 (if a (setf nv a) 249 (unless a
250 (setf a (make-bool-vector (length b) nil)) 250 (setf a (make-bool-vector (length b) nil))
251 (setf changed t)) 251 (setf changed t))
252 252