summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* EIEIO: Fix regession (bug#69631)Stefan Monnier2024-03-081-1/+1
| | | | | | | | | | | | | | Not sure why earlier tests did not catch it, but there are more places where we bump into problems because `eieio--class-precedence-list` now returns also non-EIEIO classes. * lisp/obsolete/eieio-compat.el (eieio--generic-static-object-generalizer): * lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer) (eieio--generic-subclass-specializers): Handle non-EIEIO parents. * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el (eieio-test-method-order-list-7): Adjust test.
* Single string literal in body is return value only, not doc stringMattias Engdegård2024-03-071-1/+2
| | | | | | | | | | | | | | | | | A function or macro body consisting of a single string literal now only uses it as a return value. Previously, it had the dual uses as return value and doc string, which was never what the programmer wanted and had some inconvenient consequences (bug#69387). This change applies to `lambda`, `defun`, `defsubst` and `defmacro` forms; most other defining forms already worked in the sensible way. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Don't use a lone string literal as doc string. * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el (foo): Update docstring warning test. * doc/lispref/functions.texi (Function Documentation): Update. * etc/NEWS: Announce.
* Revert "Update some native comp tests"Stefan Monnier2024-03-041-1/+1
| | | | | | | This reverts commit 4a0d430bdc3650ca3dfd8bdd14781764fbcbdc7e. AFAICT that commit was made to accomodate regressions introduced in the new `cl-preloaded.el` code and these have been fixed.
* Repair miscompilation of single-arg `apply` (bug#69533)Mattias Engdegård2024-03-041-0/+3
| | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-apply): Don't optimise single-argument `apply`; it's a legacy construct. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-62): Revert change.Andrea Corallo2024-03-031-2/+2
|
* Merge branch 'feature/type-hierarchy' into 'master'Andrea Corallo2024-03-011-2/+2
|\
| * Merge remote-tracking branch 'origin/master' into 'feature/type-hierarchy'Andrea Corallo2024-02-286-27/+60
| |\
| * | Update some native comp testsAndrea Corallo2024-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | * test/src/comp-tests.el (comp-tests-ret-type-spec-13) (comp-tests-ret-type-spec-35): Update. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-62) (comp-cstr-test-75): Likewise.
* | | Add tabulated-list-groups and Buffer-menu-group-by (bug#69305)Juri Linkov2024-02-291-0/+41
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Tabulated List Mode): Add defvar tabulated-list-groups. * lisp/buff-menu.el (Buffer-menu-group-by): New defcustom. (Buffer-menu-unmark-all-buffers): Use tabulated-list-get-entry to check whether the current line contains an entry. (list-buffers-noselect): Enable outline-minor-mode for tabulated-list-groups. (list-buffers--refresh): When Buffer-menu-group-by is non-nil, set tabulated-list-groups. (Buffer-menu-group-by-mode, Buffer-menu-group-by-root): New functions. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups): New buffer-local variable. (tabulated-list-print-fake-header): Add distinct overlay property 'fake-header'. (tabulated-list-header-overlay-p): Filter out overlays that don't have the property 'fake-header'. (tabulated-list-print): Use the variable 'tabulated-list-groups' to sort entries in groups separately. (tabulated-list-print-entries): New function factored out from 'tabulated-list-print'. * test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-groups): New test.
* | (edebug-tests-trivial-comma): Avoid interaction (bug#69406)Stefan Monnier2024-02-261-10/+12
| | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-trivial-backquote): Don't use obsolete `edebug-eval-defun`. (edebug-tests-trivial-comma): Use `inhibit-read-only`; don't use obsolete `edebug-eval-defun`; and fix bug#69406 by binding `eval-expression-debug-on-error`.
* | (cl--generic-describe): Fix regression introduced by fix to bug#54628Stefan Monnier2024-02-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Since that fix, we made other changes (put arg names in allcaps) which also happen to fix bug#54628, so we can remove the original fix which was suboptimal when the type includes quotes. * lisp/emacs-lisp/cl-generic.el (cl--generic-describe): Don't rebind `print-quoted` to nil. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--print-quoted): New test.
* | Use `defvar` for variables that are not constantStefan Monnier2024-02-071-1/+1
| | | | | | | | | | | | | | | | | | * test/lisp/international/mule-tests.el (sgml-html-meta-pre) (sgml-html-meta-post): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-file-archive) (tramp-archive-test-archive): * test/lisp/emacs-lisp/macroexp-resources/vk.el (vk-b): Don't use `defconst` if it's not constant.
* | Use slot names rather than their :initargsStefan Monnier2024-02-071-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-39-clone-instance-inheritor-with-args): * test/lisp/auth-source-tests.el (auth-source-ensure-ignored-backend) (auth-source-backend-parse-macos-keychain) (auth-source-backend-parse-macos-keychain-generic-string) (auth-source-backend-parse-macos-keychain-internet-string) (auth-source-backend-parse-macos-keychain-internet-symbol) (auth-source-backend-parse-macos-keychain-generic-symbol) (auth-source-backend-parse-macos-keychain-internet-default-string) (auth-source-backend-parse-plstore, auth-source-backend-parse-netrc) (auth-source-backend-parse-netrc-string) (auth-source-backend-parse-secrets) (auth-source-backend-parse-secrets-strings) (auth-source-backend-parse-secrets-alias) (auth-source-backend-parse-secrets-symbol) (auth-source-backend-parse-secrets-no-alias): Use slot names rather than their :initargs.
* | Grudgingly accept function values in the function positionMattias Engdegård2024-02-051-0/+16
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv-convert): Warn about (F ...) where F is a non-symbol function value (bytecode object etc), but let it pass for compatibility's sake (bug#68931). * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--fun-value-as-head): New test.
* | ; hierarchy-tests.el: keep doc string within 80 columnsMattias Engdegård2024-01-311-2/+3
|/
* ; Spelling fixesPaul Eggert2024-01-291-1/+1
|
* * test/lisp/emacs-lisp/comp-cstr-tests.el: Use macros in a simpler wayStefan Monnier2024-01-181-210/+204
| | | | | | | | (comp-cstr-test-ts): Move out of `cl-eval-when`. (comp-cstr-typespec-test): Delete. (comp-cstr-synthesize-tests): Make it take the tests as an argument. (comp-cstr-typespec-tests-alist): Delete var, pass its value to the macro instead.
* Use handler-bind to repair bytecomp-testsMattias Engdegård2024-01-041-12/+6
| | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--error-frame, bytecomp--byte-op-error-backtrace): Make test pass again and simplify, using handler-bind instead of the previous debugger hack.
* Fix ert-tests.el for the new `handler-bind` codeStefan Monnier2024-01-041-33/+8
| | | | | | | | | | | | | | | Now that `ert.el` uses `handler-bind` instead of `debugger`, some details of the behavior have changed. More specifically, three tests are now broken, but these basically tested the failure of ERT's machinery to record errors when ERT was run within a `condition-case`. AFAICT, these tests do not check for a behavior that we want, so rather than "fix" them, I deleted them (bug#67862). * test/lisp/emacs-lisp/ert-tests.el (ert-test-error-debug) (ert-test-fail-debug-with-condition-case): Delete. (ert-test-should-failure-debugging): Don't use `ert-debug-on-error`. (ert-test-with-demoted-errors): It now passes. Bug#11218 is fixed!
* ; Add 2024 to copyright yearsPo Lu2024-01-022-2/+2
|
* Merge from savannah/emacs-29Po Lu2024-01-0272-72/+72
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-0272-72/+72
| |
| * Fix rx wrong-code bug: ranges starting with ^Mattias Engdegård2023-07-301-5/+15
| | | | | | | | | | | | | | | | | | | | | | (rx (in (?^ . ?a))) was incorrectly translated to "[^-a]". Change it so that we get "[_-a^]" instead. * lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with `^` occurring first in a non-negated character alternative. * test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests. (cherry picked from commit 5f5d668ac7917d61e9366fe0c3efd7b542671c3d)
* | checkdoc: Avoid false positive for keybinding in docstringStefan Kangas2023-12-241-0/+9
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Avoid false positive when a variable contains a keybinding (for example, "C-g"). (Bug#68002) * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-docstring-avoid-false-positive-ok): New test.
* | Introduce new function lm-package-requiresStefan Kangas2023-12-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--prepare-dependencies): Move from here... * lisp/emacs-lisp/lisp-mnt.el (lm--prepare-package-dependencies): ...to here. (lm-package-requires): New function. (package-buffer-info): Use above new function. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm--tests-lm-package-requires): New test.
* | ; Fix typosStefan Kangas2023-12-101-4/+4
| |
* | Add ert-font-lockVladimir Kazanov2023-12-033-0/+470
| | | | | | | | | | | | | | | | | | Add ert-font-lock as well as unit tests and testing resources. * lisp/emacs-lisp/ert-font-lock.el: New library. * test/lisp/emacs-lisp/ert-font-lock-resources/broken.js: * test/lisp/emacs-lisp/ert-font-lock-resources/correct.js: * test/lisp/emacs-lisp/ert-font-lock-tests.el: Unit tests. (Bug#67460)
* | Make EIEIO ':accessor' behave like ':reader' when reading (bug#66938)Brandon2023-11-261-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Clones of instances of subclasses of 'eieio-instance-inheritor' didn't delegate to their ':parent-instance' field when reading object fields using ':accessor'. * lisp/emacs-lisp/eieio.el (defclass): Remove 'slot-boundp' check for :accessor's getter * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-use-accessor-function-with-cloned-object): New test. Copyright-paperwork-exempt: yes
* | Fix variable aliasing bytecode miscompilation (bug#67116)Mattias Engdegård2023-11-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler didn't cancel aliasing if the aliased variable was modified in a variable binding in the same `let` that created the alias. For example, (let ((x A)) (let ((y x) (z (setq x B))) y)) would incorrectly substitute y->x in the body form despite x being already modified at that point, which normally should have cancelled the aliasing. Bug reported by Alan Mackenzie. * lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): Now an alist that also contains the aliases; update the doc string. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): * lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Detect aliasing early for `let`-bound variables as well. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* | Fix bytecomp-tests--dest-mountpoint test failureMattias Engdegård2023-11-041-1/+2
| | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--dest-mountpoint): Add lexical cookie. Bug reported and fix suggested by Jens Schmidt (https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00719.html)
* | comp-cstr.el: The type hierarchy is a DAG, not a treeStefan Monnier2023-10-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust the type operations to account for the fact that types can have several parents. * lisp/emacs-lisp/comp-cstr.el (comp--cl-class-hierarchy): Use `cl--class-allparents`. Add FIXME. (comp--direct-supertype): Declare obsolete. (comp--direct-supertypes): New function. (comp--normalize-typeset0): Rewrite to use `comp--direct-supertypes`; adjust to account for the DAG structure; use `cl-set-difference`. (comp--direct-subtypes): Rewrite. (comp--intersection): New function. (comp-supertypes): Rewrite and change return type. (comp-subtype-p): Simplify. (comp-union-typesets): Use `comp-supertypes` instead of iterating over `comp-cstr-ctxt-typeof-types`. * lisp/emacs-lisp/comp.el (comp--native-compile): Don't catch errors if we're debugging. * test/lisp/emacs-lisp/comp-cstr-tests.el: Adjust tests. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix mishap when we evaluate (cl-defstruct cl-structure-object ..) during the compilation of `cl-preloaded.el`. * lisp/emacs-lisp/cl-preloaded.el: Add corresponding assertion.
* | Move lexical-binding warning from checkdoc to byte-compilerMattias Engdegård2023-10-212-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This warning is much more appropriate for the compiler, since lexical binding affects what it can reason and warn about, than for checkdoc as the warning has no bearing to documentation at all. The move also improves the reach of the warning. * etc/NEWS: Update. * lisp/emacs-lisp/checkdoc.el (checkdoc-lexical-binding-flag) (checkdoc-file-comments-engine): Move warning from here.... * lisp/emacs-lisp/bytecomp.el (byte-compile-file): ...to here. * test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el: * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals) (bytecomp-tests-function-put, bytecomp-tests--not-writable-directory) (bytecomp-tests--target-file-no-directory): Update tests. (bytecomp-tests--log-from-compilation) (bytecomp-tests--lexical-binding-cookie): New test.
* | Add two missing 'number-or-marker' entries to the cl machinery (bug#66615)Andrea Corallo2023-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assuming 'number-or-marker' is a type (as present multiple times in cl--typeof-types) adding some missing entries for coherency. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add 'number-or-marker' as supertype of 'number' in the 'float' branch. * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add 'number-or-marker'. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Update test. * test/src/comp-tests.el (comp-tests-type-spec-tests): Update two testes.
* | Improve cstr typeset normalizationAndrea Corallo2023-10-191-1/+10
| | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Add four tests. * lisp/emacs-lisp/comp-cstr.el (comp--sym-lessp) (comp--direct-supertype, comp--normalize-typeset0): New functions. (comp-normalize-typeset): Rework to make use of 'comp--normalize-typeset0'. (comp--direct-subtypes): New function.
* | Complete yesterday's commit for cl-print.elAlan Mackenzie2023-09-301-8/+10
| | | | | | | | | | | | | | | | | | I.e. commit the needed change to the test suite. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-ellipsis-string): Bind cl-print-string-length. Only bind print-length and print-level where they are specifically needed.
* | Revert "Don't use ellipses while cl-printing strings."Alan Mackenzie2023-09-271-1/+16
| | | | | | | | This reverts commit 761f8901fffdb155cbcc7f3b5a2329161c2c1826.
* | package-tests.el: Add test Bug#65475Philip Kaludercic2023-09-211-0/+16
| | | | | | | | | | | | * test/lisp/emacs-lisp/package-tests.el (with-package-test): Bind package-selected-packages. (package-test-bug65475): Add test.
* | Warn about duplicated :tag strings in defcustom choicesMattias Engdegård2023-09-191-1/+4
| | | | | | | | | | | | | | | | It is bad user experience when two menu items have identical labels. * lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-type): Add check. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defcustom-type): Add test case.
* | Don't use ellipses while cl-printing strings.Alan Mackenzie2023-09-191-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug#65680. The former use of print-length as a bound on the length of the printed string was erroneous, causing error messages preceding backtracees to get unnecessarily truncated to 50 characters. * lisp/emacs-lisp/cl-print.el (cl-print-object <string>): Remove the substitution of ellipses for long strings. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-ellipsis-string): Remove this test.
* | Expanded defcustom type byte-compilation warnings (bug#65852)Mattias Engdegård2023-09-171-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn about more kinds of mistakes in :type arguments of `defcustom` and `define-widget`. These include: - misplaced keyword args, as in (const red :tag "A reddish hue") - missing subordinate types, as in (repeat :tag "List of names") or (choice list string) - duplicated values, as in (choice (const yes) (const yes)) - misplaced `other` member, as in (choice (const red) (other nil) (const blue)) - various type name mistakes, as in (vector bool functionp) * lisp/emacs-lisp/bytecomp.el (byte-compile--defcustom-type-quoted) (byte-compile-nogroup-warn): Remove. (byte-compile-normal-call): Remove call to the above. (bytecomp--cus-warn, bytecomp--check-cus-type) (bytecomp--custom-declare): New.
* | Shorten docstrings generated by cl-defstructDamien Cassou2023-09-131-0/+17
| | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of generated docstrings if either the struct name or a field name is very long. This reduces the likelihood of "docstring wider than 80 characters" errors. (Bug#65790)
* | Shorten docstrings generated by cl-defsubstDamien Cassou2023-09-131-0/+11
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of the docstring into 2 lines if the function name is very long. Additionally, remove the word "inlining" in the generated docstring as it is not very useful and increases the likelihood of "docstring wider than 80 characters" errors. (Bug#65790)
* | bytecomp-tests.el: Add new helper functionDamien Cassou2023-09-131-2/+5
| | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--without-warning-test): Add helper function. (bytecomp-warn--ignore): Use the helper.
* | Add byte-compiler warning about useless trailing cond clausesMattias Engdegård2023-09-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn about clauses after the default clause, as in (cond ((= x 0) (say "none")) (t (say "some")) (say "goodbye")) because they are very much an indicator of a mistake (such as misplaced brackets), and since they are deleted by the optimiser, any other warnings there are lost and the user wouldn't know that something is wrong otherwise. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Add warning. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test case.
* | Don't cache warnings between bytecode compilation testsMattias Engdegård2023-09-091-6/+11
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-fresh-warnings): New macro. (test-byte-comp-compile-and-load, bytecomp--with-warning-test): Use it.
* | Error when trying to make nil or t obsoleteStefan Kangas2023-09-081-0/+32
| | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable): Signal error if the symbol to make obsolete is nil or t. (Bug#62248) (byte-run--constant-obsolete-warning): New function. * test/lisp/emacs-lisp/byte-run-tests.el: New file.
* | ; Silence byte-compilerStefan Kangas2023-09-061-17/+19
| | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (old-struct) (cl-lib-old-struct): * test/lisp/progmodes/eglot-tests.el (eglot-test-rust-analyzer-watches-files) (eglot-test-capabilities, eglot-test-path-to-uri-windows): Silence byte-compiler.
* | Use new ERT `skip-when` macro in testsStefan Kangas2023-09-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/autorevert-tests.el (auto-revert-test02-auto-revert-deleted-file): * test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests): * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--library-completion): * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline): * test/lisp/filenotify-tests.el (file-notify-test11-symlinks): * test/lisp/ibuffer-tests.el (ibuffer-0autoload): * test/lisp/international/ucs-normalize-tests.el (ucs-normalize-part1): * test/lisp/net/network-stream-tests.el (echo-server-nowait) (connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait) (open-network-stream-tls-wait, open-network-stream-tls-nowait) (open-network-stream-tls, open-network-stream-tls-nocert) (open-gnutls-stream-new-api-nowait) (open-gnutls-stream-old-api-nowait): * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-10483) (cperl-test-hyperactive-electric-else): * test/lisp/progmodes/elisp-mode-tests.el (eval-last-sexp-print-format-sym-echo) (eval-last-sexp-print-format-small-int-echo) (eval-last-sexp-print-format-large-int-echo) (eval-defun-prints-edebug-when-instrumented): * test/lisp/progmodes/python-tests.el (python-ffap-module-path-1): * test/lisp/shadowfile-tests.el (shadow-test00-clusters) (shadow-test01-sites, shadow-test02-files) (shadow-test03-expand-cluster-in-file-name) (shadow-test04-contract-file-name, shadow-test05-file-match) (shadow-test06-literal-groups, shadow-test07-regexp-groups) (shadow-test08-shadow-todo, shadow-test09-shadow-copy-files): * test/lisp/simple-tests.el (eval-expression-print-format-sym-echo) (eval-expression-print-format-small-int-echo) (eval-expression-print-format-large-int-echo): * test/lisp/term-tests.el (term-simple-lines) (term-carriage-return, term-line-wrap, term-colors) (term-colors-bold-is-bright, term-cursor-movement) (term-scrolling-region, term-set-directory) (term-line-wrapping-then-motion, term-to-margin): * test/lisp/thread-tests.el (thread-tests-list-threads-error-when-not-configured): * test/lisp/vc/vc-tests.el (backend): * test/manual/scroll-tests.el (scroll-tests-scroll-margin-0) (scroll-tests-scroll-margin-negative) (scroll-tests-scroll-margin-max) (scroll-tests-scroll-margin-over-max) (scroll-tests-scroll-margin-whole-window): * test/misc/test-custom-libs.el (test-custom-libs): * test/src/emacs-module-tests.el (module/async-pipe): * test/src/fileio-tests.el (fileio-tests--odd-symlink-chars): * test/src/filelock-tests.el (filelock-tests-lock-spoiled) (filelock-tests-file-locked-p-spoiled) (filelock-tests-unlock-spoiled) (filelock-tests-kill-buffer-spoiled) (filelock-tests-detect-external-change): * test/src/image-tests.el (image-tests-image-size/error-on-nongraphical-display) (image-tests-image-mask-p/error-on-nongraphical-display) (image-tests-image-metadata/error-on-nongraphical-display): * test/src/process-tests.el (make-process/mix-stderr) (process-tests/fd-setsize-no-crash/make-network-process) (process-tests/fd-setsize-no-crash/make-serial-process): Use ERT `skip-when` macro in tests.
* | Add `skip-when` macro to `ert-deftest`Stefan Kangas2023-09-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can help avoid some awkward test skip conditions. For example, this triple negation: (skip-unless (not noninteractive)) Can be written as the simpler: (skip-when noninteractive) * lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro. (ert--skip-when): New internal function. * doc/misc/ert.texi (Tests and Their Environment): Document above new macro. * test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.
* | Fix debug spec of cl-flet (bug#65344)Gerd Möllmann2023-08-211-0/+17
| | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-flet): Fix debug spec. (cl-defun): Allow only symbols as function names in debug spec. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-flet/edebug): New test case.