aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Kangas2025-02-22 19:14:51 +0100
committerStefan Kangas2025-02-23 00:38:22 +0100
commit042dc5929b706b5fbc0ea8ada6014661d44a1b53 (patch)
tree56a6912abd934f2b540f414d4b84ceaad9f7fccd /test/src
parent9d7d4db7eb3398e754872f4c82d3d2071ae10fb2 (diff)
downloademacs-042dc5929b706b5fbc0ea8ada6014661d44a1b53.tar.gz
emacs-042dc5929b706b5fbc0ea8ada6014661d44a1b53.zip
Prefer incf to cl-incf in tests
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-reify-function): * test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-for-as-arith-order-side-effects) (cl-macs-loop-for-as-equals-then, cl-macs-loop-do, cl-macs-loop-finally) (cl-macs-loop-in-ref, cl-macs-loop-being-elements-of-ref) (cl-macs-test--symbol-macrolet, cl-the): * test/lisp/emacs-lisp/cl-seq-tests.el (cl-lib-test-remove) (cl-lib-test-remove-if-not): * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-range): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-deduplicate): * test/lisp/emacs-lisp/generator-tests.el (cps-while-incf): (cps-test-iter-cleanup-once-only): * test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-labelfn-button-if-does-not-button-unless-condition) (hierarchy-labelfn-button-if-does-button-when-condition): * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-evaluate-once): * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp, lisp-indent-region): * test/lisp/emacs-lisp/map-tests.el (test-map-elt-gv) (test-setf-map-with-function): * test/lisp/emacs-lisp/multisession-tests.el (multi-test-sqlite-simple) (multi-test-sqlite-busy, multi-test-files-simple) (multi-test-files-busy): * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test, oclosure-test-mutate): * test/lisp/emacs-lisp/track-changes-tests.el (track-changes-tests--random): * test/lisp/files-tests.el (files-tests--with-buffer-offer-save): * test/lisp/net/shr-tests.el (shr-test/zoom-image): * test/lisp/replace-tests.el (replace-tests-with-undo): * test/src/buffer-tests.el (test-overlay-randomly): * test/src/data-tests.el (test-bool-vector-bv-from-hex-string): * test/src/fns-tests.el (fns-tests-sort): * test/src/json-tests.el (json-insert/signal, json-insert/throw): * test/src/minibuf-tests.el (minibuf-tests--strings-to-symbol-alist) (minibuf-tests--strings-to-string-alist) (minibuf-tests--strings-to-string-hashtable) (minibuf-tests--strings-to-symbol-hashtable): * test/src/process-tests.el (make-process/file-handler/found): Prefer incf to cl-incf.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/buffer-tests.el4
-rw-r--r--test/src/data-tests.el2
-rw-r--r--test/src/fns-tests.el2
-rw-r--r--test/src/json-tests.el4
-rw-r--r--test/src/minibuf-tests.el8
-rw-r--r--test/src/process-tests.el2
6 files changed, 11 insertions, 11 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 4d608fa9d24..b4b9e761986 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1753,7 +1753,7 @@ quae ab illo inventore veritatis et quasi architecto beatae vitae
1753dicta sunt, explicabo. ")) 1753dicta sunt, explicabo. "))
1754 1754
1755 (while (< iteration-count iteration-target) 1755 (while (< iteration-count iteration-target)
1756 (cl-incf iteration-count) 1756 (incf iteration-count)
1757 1757
1758 ;; Toggle GROWING if we've reached a size boundary. The idea 1758 ;; Toggle GROWING if we've reached a size boundary. The idea
1759 ;; is to initially steadily increase the overlay count, then 1759 ;; is to initially steadily increase the overlay count, then
@@ -1780,7 +1780,7 @@ dicta sunt, explicabo. "))
1780 (ov (make-overlay begin end nil 1780 (ov (make-overlay begin end nil
1781 (= 0 (random 2)) (= 0 (random 2))))) 1781 (= 0 (random 2)) (= 0 (random 2)))))
1782 (aset overlays overlay-count ov) 1782 (aset overlays overlay-count ov)
1783 (cl-incf overlay-count))) 1783 (incf overlay-count)))
1784 ((and (not create-overlay) (> overlay-count 0)) 1784 ((and (not create-overlay) (> overlay-count 0))
1785 1785
1786 ;; Possibly delete a random overlay. 1786 ;; Possibly delete a random overlay.
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 44c786ac579..260bdb281bb 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -185,7 +185,7 @@ this is exactly representable and is greater than
185 (dolist (n (nreverse nibbles)) 185 (dolist (n (nreverse nibbles))
186 (dotimes (_ 4) 186 (dotimes (_ 4)
187 (aset bv i (oddp n)) 187 (aset bv i (oddp n))
188 (cl-incf i) 188 (incf i)
189 (setf n (ash n -1))))) 189 (setf n (ash n -1)))))
190 bv)) 190 bv))
191 191
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index eebc92bfd41..3d6cd5de8fe 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -345,7 +345,7 @@
345 (counter 0) 345 (counter 0)
346 (my-counter (lambda () 346 (my-counter (lambda ()
347 (if (< counter 500) 347 (if (< counter 500)
348 (cl-incf counter) 348 (incf counter)
349 (setq counter 0) 349 (setq counter 0)
350 (garbage-collect)))) 350 (garbage-collect))))
351 (rand 1) 351 (rand 1)
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 941caae9431..94b6cfcffca 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -357,7 +357,7 @@ Test with both unibyte and multibyte strings."
357 (let ((calls 0)) 357 (let ((calls 0))
358 (add-hook 'after-change-functions 358 (add-hook 'after-change-functions
359 (lambda (_begin _end _length) 359 (lambda (_begin _end _length)
360 (cl-incf calls) 360 (incf calls)
361 (signal 'json-tests--error 361 (signal 'json-tests--error
362 '("Error in `after-change-functions'"))) 362 '("Error in `after-change-functions'")))
363 :local) 363 :local)
@@ -371,7 +371,7 @@ Test with both unibyte and multibyte strings."
371 (let ((calls 0)) 371 (let ((calls 0))
372 (add-hook 'after-change-functions 372 (add-hook 'after-change-functions
373 (lambda (_begin _end _length) 373 (lambda (_begin _end _length)
374 (cl-incf calls) 374 (incf calls)
375 (throw 'test-tag 'throw-value)) 375 (throw 'test-tag 'throw-value))
376 :local) 376 :local)
377 (should 377 (should
diff --git a/test/src/minibuf-tests.el b/test/src/minibuf-tests.el
index ec8f7123234..2f932eacc4a 100644
--- a/test/src/minibuf-tests.el
+++ b/test/src/minibuf-tests.el
@@ -29,10 +29,10 @@
29 (mapcar #'intern list)) 29 (mapcar #'intern list))
30(defun minibuf-tests--strings-to-symbol-alist (list) 30(defun minibuf-tests--strings-to-symbol-alist (list)
31 (let ((num 0)) 31 (let ((num 0))
32 (mapcar (lambda (str) (cons (intern str) (cl-incf num))) list))) 32 (mapcar (lambda (str) (cons (intern str) (incf num))) list)))
33(defun minibuf-tests--strings-to-string-alist (list) 33(defun minibuf-tests--strings-to-string-alist (list)
34 (let ((num 0)) 34 (let ((num 0))
35 (mapcar (lambda (str) (cons str (cl-incf num))) list))) 35 (mapcar (lambda (str) (cons str (incf num))) list)))
36(defun minibuf-tests--strings-to-obarray (list) 36(defun minibuf-tests--strings-to-obarray (list)
37 (let ((ob (obarray-make 7))) 37 (let ((ob (obarray-make 7)))
38 (mapc (lambda (str) (intern str ob)) list) 38 (mapc (lambda (str) (intern str ob)) list)
@@ -40,12 +40,12 @@
40(defun minibuf-tests--strings-to-string-hashtable (list) 40(defun minibuf-tests--strings-to-string-hashtable (list)
41 (let ((ht (make-hash-table :test #'equal)) 41 (let ((ht (make-hash-table :test #'equal))
42 (num 0)) 42 (num 0))
43 (mapc (lambda (str) (puthash str (cl-incf num) ht)) list) 43 (mapc (lambda (str) (puthash str (incf num) ht)) list)
44 ht)) 44 ht))
45(defun minibuf-tests--strings-to-symbol-hashtable (list) 45(defun minibuf-tests--strings-to-symbol-hashtable (list)
46 (let ((ht (make-hash-table :test #'equal)) 46 (let ((ht (make-hash-table :test #'equal))
47 (num 0)) 47 (num 0))
48 (mapc (lambda (str) (puthash (intern str) (cl-incf num) ht)) list) 48 (mapc (lambda (str) (puthash (intern str) (incf num) ht)) list)
49 ht)) 49 ht))
50 50
51;;; Functions that produce a predicate (for *-completion functions) 51;;; Functions that produce a predicate (for *-completion functions)
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 21972b86aa0..7634cec2207 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -352,7 +352,7 @@ works as expected if a file name handler is found."
352 (should (equal args '(make-process :name "name" 352 (should (equal args '(make-process :name "name"
353 :command ("/some/binary") 353 :command ("/some/binary")
354 :file-handler t))) 354 :file-handler t)))
355 (cl-incf file-handler-calls) 355 (incf file-handler-calls)
356 'fake-process)) 356 'fake-process))
357 (let ((file-name-handler-alist (list (cons (rx bos "test-handler:") 357 (let ((file-name-handler-alist (list (cons (rx bos "test-handler:")
358 #'file-handler))) 358 #'file-handler)))