Subject: bug#75633: [PATCH] New unit-tests for cl-lib

From: Ahmed Khanzada <[email-masked]>
Date: Sat, 18 Jan 2025 09:19:43 -0500

Thanks for catching oddp and evenp, I suppose I must still have an
outdated cl library without the prefix floating in my Emacs
instance. Some packages still use it unfortunately, even after I submit
patches updating them to cl-lib.

Yes, I will look into the cl-seq-tests byecompiling warnings and fix them.

Thank you,
Ahmed

Eli Zaretskii <[email-masked]> writes:

>> From: Ahmed Khanzada <[email-masked]>
>> Date: Fri, 17 Jan 2025 09:52:32 -0500
>> 
>> In response to the concerns about cl-lib last year (or was it the year
>> before that?), I have written new unit tests that cover almost all cl-lib
>> functions without tests in the cl-lib.el, cl-extra.el, and cl-seq.el
>> files, with the notable exception of the tree functions. (I'll probably
>> do those later).
>
> Thanks, additions to the test suite are always welcome.
>
> I've installed this on the master branch, but I found a couple of
> problems with the new tests:
>
>   . they use 'oddp' and 'evenp', which don't exist; I replaced them
>     with 'cl-oddp' and 'cl-evenp' -- if that is incorrect, please
>     submit followup patches to fix my changes
>   . cl-seq-tests.el emits warnings when byte compiling it (shown
>     below); could you please fix those?
>
>     ELC      lisp/emacs-lisp/cl-seq-tests.elc
>
>   In toplevel form:
>   lisp/emacs-lisp/cl-seq-tests.el:179:6: Warning: value from call to `cl-delete-if' is unused
>   lisp/emacs-lisp/cl-seq-tests.el:249:49: Warning: Unused lexical argument `n'
>   lisp/emacs-lisp/cl-seq-tests.el:393:39: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:395:39: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:415:43: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:417:43: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:491:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:493:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:495:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:497:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:501:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:503:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:505:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:509:18: Warning: `cl-sort' on constant list (arg 1)
>
>   lisp/emacs-lisp/cl-seq-tests.el:513:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:515:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:517:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:519:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:523:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:525:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:527:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:531:18: Warning: `cl-stable-sort' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:535:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:535:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:537:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:537:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:539:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:541:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:545:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:545:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:549:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:549:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:551:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:551:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:553:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:553:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:555:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:555:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:557:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:557:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:559:18: Warning: `cl-merge' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:559:18: Warning: `cl-merge' on constant list (arg 3)
>   lisp/emacs-lisp/cl-seq-tests.el:589:42: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:591:42: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:617:46: Warning: Unused lexical argument `x'
>   lisp/emacs-lisp/cl-seq-tests.el:779:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:779:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:785:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:785:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:791:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:791:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:797:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:797:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:803:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:803:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:809:20: Warning: `cl-nintersection' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:809:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:815:20: Warning: `cl-nintersection' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:849:6: Warning: value from call to `cl-set-difference' is unused
>   lisp/emacs-lisp/cl-seq-tests.el:856:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:856:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:862:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:868:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:868:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:874:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:874:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:880:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:880:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:886:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:886:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:892:22: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:902:20: Warning: `cl-nset-difference' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:902:20: Warning: `cl-nset-difference' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:936:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:936:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:942:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:948:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:948:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:954:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:954:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:960:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:960:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:966:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:966:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:972:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:972:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:978:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)
>   lisp/emacs-lisp/cl-seq-tests.el:988:20: Warning: `cl-nset-exclusive-or' on constant list (arg 1)
>   lisp/emacs-lisp/cl-seq-tests.el:988:20: Warning: `cl-nset-exclusive-or' on constant list (arg 2)