[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50965: Allow nil third argument for mapconcat
From: |
Eli Zaretskii |
Subject: |
bug#50965: Allow nil third argument for mapconcat |
Date: |
Sun, 03 Oct 2021 08:56:23 +0300 |
> From: Stefan Kangas <stefan@marxist.se>
> Date: Sun, 3 Oct 2021 01:03:54 +0200
> Cc: 50965@debbugs.gnu.org
>
> +Optional argument SEPARATOR must be a string, a vector, or a list of
> +characters; nil is the empty string."
nil is not a string, so saying that is not the best wording. I
suggest "nil stands for an empty string." instead.
> +Optional argument SEPARATOR must be a string, a vector, or a list of
> +characters; nil is the empty string.
Likewise.
> +(ert-deftest fns-tests-mapconcat ()
> + (should (string= (mapconcat #'identity '() "_") ""))
> + (should (string= (mapconcat #'identity '("A") "_") "A"))
> + (should (string= (mapconcat #'identity '("A" "B") "_") "A_B"))
> + (should (string= (mapconcat #'identity '("A" "B" "C") "_") "A_B_C"))
> + (should (string= (mapconcat #'identity '("a" "b")) "ab")))
Please be sure to test with vectors, bool-vectors, list of characters,
and non-ASCII strings as well.
> I'm assuming this should go to master at this point.
Yes, thanks.