test: Remove redundant "" arg to mapconcat
* test/src/process-tests.el (process-test-stderr-filter): * test/src/print-tests.el (print-tests-continuous-numbering): * test/src/fns-tests.el (fns-tests-mapconcat): * test/src/data-tests.el (test-bool-vector-to-hex-string): * test/src/casefiddle-tests.el (casefiddle-tests-char-properties) (casefiddle-tests-case-table, casefiddle-tests-casing-character): * test/lisp/tabify-tests.el (tabify-tests--test-changes): * test/lisp/subr-tests.el (subr-tests-bug22027): * test/lisp/sort-tests.el (sort-tests-random-word): * test/lisp/net/hmac-md5-tests.el (hmac-md5-test-encode-string): * test/lisp/md4-tests.el (md4-tests-digest->hex): * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map): * test/lisp/dired-tests.el (dired-test-directory-files): * test/lisp/char-fold-tests.el (char-fold--random-word): * test/lisp/ansi-color-tests.el (ansi-color-incomplete-sequences-test): Remove redundant "" arg to `mapconcat`.
This commit is contained in:
parent
048b0fd0db
commit
112cb75141
14 changed files with 24 additions and 23 deletions
|
|
@ -135,7 +135,7 @@ strings with `eq', this function compares them with `equal'."
|
|||
(with-temp-buffer
|
||||
(should (equal-including-properties
|
||||
filtered-str
|
||||
(mapconcat ansi-filt strs ""))))
|
||||
(mapconcat ansi-filt strs))))
|
||||
|
||||
;; Tests for `ansi-color-filter-region'
|
||||
(with-temp-buffer
|
||||
|
|
@ -156,7 +156,7 @@ strings with `eq', this function compares them with `equal'."
|
|||
(with-temp-buffer
|
||||
(should (ansi-color-tests-equal-props
|
||||
propertized-str
|
||||
(mapconcat ansi-app strs ""))))
|
||||
(mapconcat ansi-app strs))))
|
||||
|
||||
;; Tests for `ansi-color-apply-on-region'
|
||||
(with-temp-buffer
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
(defun char-fold--random-word (n)
|
||||
(mapconcat (lambda (_) (string (+ 9 (random 117))))
|
||||
(make-list n nil) ""))
|
||||
(make-list n nil)))
|
||||
|
||||
(defun char-fold--ascii-upcase (string)
|
||||
"Like `upcase' but acts on ASCII characters only."
|
||||
|
|
|
|||
|
|
@ -456,8 +456,8 @@
|
|||
(dolist (file '(a b c d))
|
||||
(make-empty-file (expand-file-name (symbol-name file) testdir)))
|
||||
(should (= 6 (length (directory-files testdir))))
|
||||
(should (equal "abcd" (mapconcat 'identity (directory-files
|
||||
testdir nil nod) "")))
|
||||
(should (equal "abcd" (mapconcat #'identity (directory-files
|
||||
testdir nil nod))))
|
||||
(should (= 2 (length (directory-files testdir nil "[bc]"))))
|
||||
(should (= 3 (length (directory-files testdir nil nod nil 3))))
|
||||
(dolist (file '(5 4 3 2 1))
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
(fn3 (lambda (x _y _z) (string-to-char (format "%S" x)))))
|
||||
(should (equal lst (cl-map 'list fn1 lst)))
|
||||
(should (equal (vconcat lst2) (cl-map 'vector fn2 lst lst2)))
|
||||
(should (equal (mapconcat (lambda (x) (format "%S" x)) lst "")
|
||||
(should (equal (mapconcat (lambda (x) (format "%S" x)) lst)
|
||||
(cl-map 'string fn3 lst lst2 lst3)))))
|
||||
|
||||
(ert-deftest cl-extra-test-maplist ()
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
(defun md4-tests-digest->hex (str)
|
||||
"Print digest STR in hexadecimal."
|
||||
(mapconcat (lambda (x) (format "%02x" x)) str ""))
|
||||
(mapconcat (lambda (x) (format "%02x" x)) str))
|
||||
|
||||
(ert-deftest md4-test-rfc1320 ()
|
||||
"Verify the test suite results in RFC 1320.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
(should (equal (encode-hex-string
|
||||
(hmac-md5 (decode-hex-string
|
||||
(mapconcat (lambda (c) (concat (list c) "d"))
|
||||
(make-string 50 ?c) ""))
|
||||
(make-string 50 ?c)))
|
||||
(decode-hex-string "0102030405060708090a0b0c0d0e0f10111213141516171819")))
|
||||
"697eaf0aca3a3aea3a75164746ffaa79"))
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
(mapconcat (lambda (_) (string (let ((c (random 52)))
|
||||
(+ (if (> c 25) 71 65)
|
||||
c))))
|
||||
(make-list n nil) ""))
|
||||
(make-list n nil)))
|
||||
|
||||
(defun sort-tests--insert-words-sort-and-compare (words separator function reverse less-predicate)
|
||||
(with-temp-buffer
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ cf. Bug#25477."
|
|||
(let ((default "foo") res)
|
||||
(cl-letf (((symbol-function 'read-string)
|
||||
(lambda (_prompt &optional _init _hist def _inher-input) def)))
|
||||
(setq res (read-passwd "pass: " 'confirm (mapconcat #'string default "")))
|
||||
(setq res (read-passwd "pass: " 'confirm (mapconcat #'string default)))
|
||||
(should (string= default res)))))
|
||||
|
||||
(ert-deftest subr-tests--gensym ()
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
(defun tabify-tests--test-changes (fun changes width)
|
||||
(with-temp-buffer
|
||||
(let ((tab-width width))
|
||||
(insert (mapconcat #'car changes ""))
|
||||
(insert (mapconcat #'car changes))
|
||||
(funcall fun (point-min) (point-max))
|
||||
(should (equal (buffer-string) (mapconcat #'cadr changes ""))))))
|
||||
(should (equal (buffer-string) (mapconcat #'cadr changes))))))
|
||||
|
||||
(ert-deftest tabify-tests-untabify ()
|
||||
(let ((changes '(("***\n" "***\n")
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
errors)))
|
||||
(setq expected (cdr expected)))))
|
||||
(when errors
|
||||
(ert-fail (mapconcat (lambda (line) line) (nreverse errors) "")))))
|
||||
(ert-fail (mapconcat #'identity (nreverse errors))))))
|
||||
|
||||
|
||||
(defconst casefiddle-tests--characters
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
errors)))
|
||||
(setq props (cdr props) tabs (cdr tabs) expected (cdr expected)))))
|
||||
(when errors
|
||||
(mapconcat (lambda (line) line) (nreverse errors) "")))))
|
||||
(mapconcat #'identity (nreverse errors))))))
|
||||
|
||||
|
||||
(ert-deftest casefiddle-tests-casing-character ()
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
errors)))
|
||||
(setq funcs (cdr funcs) expected (cdr expected)))))
|
||||
(when errors
|
||||
(mapconcat (lambda (line) line) (nreverse errors) "")))))
|
||||
(mapconcat (lambda (line) line) (nreverse errors))))))
|
||||
|
||||
|
||||
(ert-deftest casefiddle-tests-casing-word ()
|
||||
|
|
|
|||
|
|
@ -200,8 +200,7 @@ this is exactly representable and is greater than
|
|||
nibbles)
|
||||
(setf v (nthcdr 4 v)))
|
||||
(mapconcat (lambda (n) (format "%X" n))
|
||||
(nreverse nibbles)
|
||||
"")))
|
||||
(nreverse nibbles))))
|
||||
|
||||
(defun test-bool-vector-count-consecutive-tc (desc)
|
||||
"Run a test case for `bool-vector-count-consecutive'.
|
||||
|
|
|
|||
|
|
@ -614,9 +614,9 @@
|
|||
(should (string= (mapconcat #'identity '("Ä" "ø" "☭" "தமிழ்") "_漢字_")
|
||||
"Ä_漢字_ø_漢字_☭_漢字_தமிழ்"))
|
||||
;; vector
|
||||
(should (string= (mapconcat #'identity ["a" "b"] "") "ab"))
|
||||
(should (string= (mapconcat #'identity ["a" "b"]) "ab"))
|
||||
;; bool-vector
|
||||
(should (string= (mapconcat #'identity [nil nil] "") ""))
|
||||
(should (string= (mapconcat #'identity [nil nil]) ""))
|
||||
(should-error (mapconcat #'identity [nil nil t])
|
||||
:type 'wrong-type-argument))
|
||||
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ otherwise, use a different charset."
|
|||
"Printing observes `print-continuous-numbering'."
|
||||
;; cl-print does not support print-continuous-numbering.
|
||||
:expected-result (if (eq (symbol-function #'print-tests--prin1-to-string)
|
||||
#'cl-prin1-to-string) :failed :passed)
|
||||
#'cl-prin1-to-string)
|
||||
:failed :passed)
|
||||
(let* ((x (list 1))
|
||||
(y "hello")
|
||||
(g (gensym))
|
||||
|
|
@ -201,7 +202,8 @@ otherwise, use a different charset."
|
|||
(print-number-table nil))
|
||||
(should (string-match
|
||||
"(#1=(1) #1# #2=\"hello\" #2#)(#3=#:g[[:digit:]]+ #3#)(#1# #2# #3#)#2#$"
|
||||
(mapconcat #'print-tests--prin1-to-string `((,x ,x ,y ,y) (,g ,g) (,x ,y ,g) ,y) ""))))
|
||||
(mapconcat #'print-tests--prin1-to-string
|
||||
`((,x ,x ,y ,y) (,g ,g) (,x ,y ,g) ,y)))))
|
||||
|
||||
;; This is the special case for byte-compile-output-docform
|
||||
;; mentioned in a comment in print_preprocess. When
|
||||
|
|
|
|||
|
|
@ -134,12 +134,12 @@ process to complete."
|
|||
(should (equal 1 (with-current-buffer stdout-buffer
|
||||
(point-max))))
|
||||
(should (equal "hello stdout!\n"
|
||||
(mapconcat #'identity (nreverse stdout-output) "")))
|
||||
(mapconcat #'identity (nreverse stdout-output))))
|
||||
(should stderr-sentinel-called)
|
||||
(should (equal 1 (with-current-buffer stderr-buffer
|
||||
(point-max))))
|
||||
(should (equal "hello stderr!\n"
|
||||
(mapconcat #'identity (nreverse stderr-output) ""))))))
|
||||
(mapconcat #'identity (nreverse stderr-output)))))))
|
||||
|
||||
(ert-deftest set-process-filter-t ()
|
||||
"Test setting process filter to t and back." ;; Bug#36591
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue