1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00
emacs/test/lisp/emacs-lisp
Basil L. Contovounesios 9da2efb670 Audit some plist uses with new predicate argument
* doc/lispref/lists.texi (Plist Access): Improve description of
default predicate.
* lisp/emacs-lisp/cl-extra.el (cl-getf, cl--set-getf): Assume
plist-member always returns a cons.
* lisp/emacs-lisp/gv.el (plist-get): Support new optional predicate
argument (bug#47425#91).
* lisp/emacs-lisp/map.el: Bump minor version.
(map--dispatch): Remove now that bug#58563 is fixed.  Break two
remaining uses out into corresponding cl-defmethods.
(map--plist-p): Add docstring.
(map--plist-has-predicate, map--plist-member-1, map--plist-member)
(map--plist-put-1, map--plist-put): New definitions for supporting
predicate argument backward compatibly.
(map-elt): Fix generalized variable getter under a
predicate (bug#58531).  Use predicate when given a plist.
(map-put): Avoid gratuitous warnings when called without the hidden
predicate argument.  Improve obsoletion message.
(map-put!): Use predicate when given a plist.
(map-contains-key): Ditto.  Declare forgotten
advertised-calling-convention (bug#58531#19).
(map--put): Group definition in file together with that of map-put!.
* lisp/files-x.el (connection-local-normalize-criteria): Simplify
using mapcan + plist-get.
* lisp/net/eudc.el (eudc--plist-member): New convenience function.
(eudc-plist-member, eudc-plist-get, eudc-lax-plist-get): Use it
instead of open-coding plist-member.
* src/fns.c (Fplist_get, plist_get, Fplist_put, plist_put): Pass the
plist element as the first argument to the predicate, for
consistency with assoc + alist-get.
(Fplist_member, plist_member): Move from widget to plist section.
Open-code the EQ case in plist_member, and call it from
Fplist_member in that case, rather than the other way around.

* test/lisp/apropos-tests.el (apropos-tests-format-plist): Avoid
polluting obarray.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): Extend test with
generalized variables, degenerate plists, and improper lists.
* test/lisp/emacs-lisp/gv-tests.el: Byte-compile file; in the
meantime bug#24402 seems to have been fixed or worked around.
(gv-setter-edebug): Inhibit printing messages.
(gv-plist-get): Avoid modifying constant literals.  Also test with a
predicate argument.
* test/lisp/emacs-lisp/map-tests.el (with-maps-do): Simplify
docstring.
(test-map-elt-testfn): Rename...
(test-map-elt-testfn-alist): ...to this.  Also test with a predicate
argument.
(test-map-elt-testfn-plist, test-map-elt-gv, test-map-elt-signature)
(test-map-put!-plist, test-map-put!-signature)
(test-map-contains-key-signature, test-map-plist-member)
(test-map-plist-put): New tests.
(test-map-contains-key-testfn): Also test with a predicate argument.
(test-map-setf-alist-overwrite-key, test-map-setf-plist-insert-key)
(test-map-setf-plist-overwrite-key): Avoid modifying constant
literals.
(test-hash-table-setf-insert-key)
(test-hash-table-setf-overwrite-key): Fix indentation.
(test-setf-map-with-function): Make test more precise.
* test/lisp/net/eudc-tests.el: New file.
* test/lisp/subr-tests.el (test-plistp): Extend test with circular
list.
* test/src/fns-tests.el (test-cycle-equal, test-cycle-nconc): Move
from plist section to circular list section.
(plist-put/odd-number-of-elements): Avoid modifying constant
literals.
(plist-member/improper-list): Simplify.
(test-plist): Move to plist section.  Also test with a predicate
argument.
2022-10-22 19:33:12 +03:00
..
bytecomp-resources Don't rewrite set to setq of lexical variables 2022-09-22 14:54:15 +02:00
edebug-resources ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
eieio-tests Silence byte-compiler in eieio tests 2022-01-03 05:00:11 +01:00
faceup-resources ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
faceup-tests ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
macroexp-resources ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
package-resources package.el: Understand a few more variations in tarball formats 2022-10-08 12:19:40 -04:00
pp-resources Fix pp-emacs-lisp-code printing of cons cells 2022-05-17 19:45:20 +02:00
shadow-resources Use lexical-binding in most remaining emacs-lisp tests 2020-04-30 12:09:51 +02:00
testcover-resources Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
backquote-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
backtrace-tests.el Prefer pos-bol and pos-eol in tests 2022-08-21 17:45:04 +02:00
benchmark-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
bindat-tests.el Bindat (src, strz): Operate on vectors too 2022-10-21 11:26:36 -04:00
bytecomp-tests.el Don't rewrite set to setq of lexical variables 2022-09-22 14:54:15 +02:00
cconv-tests.el cconv.el: Fix interactive closure bug#51695 2022-09-23 16:36:16 -04:00
check-declare-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
checkdoc-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
cl-extra-tests.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
cl-generic-tests.el cl-generic: Fix advertised-calling-convention declarations 2022-10-16 12:01:47 -04:00
cl-lib-tests.el cl-symbol-macrolet: Fix recent regression 2022-09-06 00:08:35 -04:00
cl-macs-tests.el Improve check for misleading 'cl-case' cases (Bug#57915). 2022-09-19 13:34:51 +02:00
cl-preloaded-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
cl-print-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
cl-seq-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
comp-cstr-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
comp-tests.el Silence recent comp-tests.el lexvar warnings 2022-10-17 21:02:26 +03:00
copyright-tests.el Fix copyright-fix-years, use a dash to separate years in a range 2022-01-28 15:23:05 +01:00
derived-tests.el ; * test/lisp/emacs-lisp/derived-tests.el: Silence byte-compiler. 2022-01-26 00:44:00 +01:00
easy-mmode-tests.el Move buffer-local-set-state to subr because it's used at runtime 2022-05-06 16:09:38 +02:00
edebug-tests.el Don't bind `s' in the normal backtrace map 2022-09-09 19:29:21 +02:00
ert-tests.el Fix EMBA failure for ert-test-record-backtrace 2022-03-12 22:40:49 +01:00
ert-x-tests.el ert-x: New `ert-with-test-buffer-selected' convenience macro 2022-09-11 13:46:30 +02:00
find-func-tests.el Prefer pos-bol and pos-eol in tests 2022-08-21 17:45:04 +02:00
float-sup-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
generator-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
gv-tests.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
hierarchy-tests.el Use lexical-binding in more tests 2020-08-29 22:41:51 +02:00
icons-tests.el Add support for user-customizable icons 2022-07-28 14:39:38 +02:00
let-alist-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
lisp-mnt-tests.el ; Copyright year fixes 2022-01-01 10:02:17 -08:00
lisp-mode-tests.el Disable a lisp-mode test that now fails 2022-08-23 12:49:13 +02:00
lisp-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
macroexp-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
map-tests.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
memory-report-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
multisession-tests.el ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
nadvice-tests.el * test/lisp/emacs-lisp/nadvice-tests.el: Re-add no-byte-compile. 2022-08-08 13:47:15 +02:00
oclosure-tests.el (oclosure-test-limits): Fix test failure when interpreted 2022-06-26 13:15:15 -04:00
package-tests.el package.el: Understand a few more variations in tarball formats 2022-10-08 12:19:40 -04:00
pcase-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
pp-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
range-tests.el Reduce code duplication in parts of (auto)load&defalias 2022-01-28 13:19:11 -05:00
regexp-opt-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
ring-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
rmc-tests.el Make `?' work again in read-multiple-choice 2022-03-17 12:55:39 +01:00
rx-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
seq-tests.el Add 'seq-keep' 2022-10-04 21:44:52 +02:00
shadow-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
shortdoc-tests.el Test that buffer exists in shortdoc-all-groups-work 2022-01-04 03:52:42 +01:00
subr-x-tests.el Fix off-by-one error in string-truncate-left 2022-07-23 08:58:53 +02:00
syntax-tests.el Remove no-byte-compile cookie from some libraries 2022-08-08 11:50:33 +02:00
tabulated-list-tests.el ; Fix tabulated-list-mode tests after revert 2022-01-11 06:17:59 +01:00
testcover-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
text-property-search-tests.el Make two text-property-search tests easier to read 2022-06-29 13:54:51 +02:00
thunk-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
timer-tests.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
unsafep-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
vtable-tests.el Add a new library to format variable-pitch tables 2022-02-19 13:16:28 +01:00
warnings-tests.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00