Fix cl-seq-tests.el
None of the tests using the macro cl-seq--with-side-effects were being evaluated (since bug#24264), and other tests were not robust against destructive operations or optimizations (since bug#24264 and bug#75633). For further discussion, see: https://lists.gnu.org/r/emacs-devel/2025-02/msg00053.html * test/lisp/emacs-lisp/cl-seq-tests.el: Fit first line within 80 columns. Remove empty Commentary section. (cl-union-test-00): Use bug#N reference in place of URL. (cl-seq-test-bug24264): Ditto. Use nconc in place of append. (cl-seq--test-list, cl-seq--test-list2, cl-seq--with-side-effects): Remove. (cl-seq-tests--relet*): New convenience macro replacing the need for cl-seq--with-side-effects. (cl-seq-fill-test, cl-seq-replace-test, cl-seq-delete-test): Use cl-seq-tests--relet* to actually evaluate tests. Avoid mutating quoted literals. (cl-seq-nsubstitute-test): Ditto. Actually call cl-nsubstitute, not cl-substitute. Avoid comparing mutated argument to itself; compare to its original copy instead. Avoid calling cl-position on list that is being mutated in :if predicate; use original copy instead. (cl-seq-remove-test, cl-remove-if-not-test, cl-delete-if-not-test) (cl-delete-duplicates-test, cl-seq-remove-duplicates-test) (cl-seq-substitute-test, cl-seq-substitute-if-test) (cl-seq-position-test, cl-count-if-test, cl-count-if-not-test) (cl-member-if-test, cl-member-if-not-test, cl-assoc-if-test) (cl-assoc-if-not-test, cl-rassoc-if-test, cl-subsetp-test): Simplify. (cl-remove-if-test, cl-seq-substitute-if-not-test, cl-find-if-test) (cl-find-if-not-test, cl-position-if-test, cl-member-test) (cl-assoc-test, cl-rassoc-test): Quote function symbols, not lambdas. (cl-delete-if-test): Use cl-seq-tests--relet*. Check result of cl-delete-if to avoid relying on its side effects, and to pacify byte-compiler warning. (cl-seq-mismatch-test): Avoid 'easy to misread' hidden argument. (cl-seq-search-test): Break long line. (cl-sort-test, cl-stable-sort-test, cl-merge-test): Avoid mutating quoted literals. (cl-intersection-test): Avoid comparing eql-ity of string literals. (cl-nintersection-test, cl-nset-difference-test) (cl-nset-exclusive-or-test): Avoid mutating quoted literals. Don't compare initial and final values of arguments, since they may have been mutated. (cl-set-difference-test, cl-set-exclusive-or-test): Use fresh arguments to check for absence of mutation.
This commit is contained in:
parent
9746fbc264
commit
52034675a2
1 changed files with 401 additions and 497 deletions
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue