diff options
| author | Stefan Kangas | 2025-02-17 04:52:49 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-02-17 05:37:10 +0100 |
| commit | 5ce746c3b0fa3a0b73796182960ff06cf3f31473 (patch) | |
| tree | da6a18b124a472af60562dbd82253c55d5eec78a /test/src | |
| parent | 657f4658a7141708adb7f3ca594145f2df569d4c (diff) | |
| download | emacs-5ce746c3b0fa3a0b73796182960ff06cf3f31473.tar.gz emacs-5ce746c3b0fa3a0b73796182960ff06cf3f31473.zip | |
Prefer oddp/evenp to free-coding them in tests
* test/lisp/emacs-lisp/bindat-tests.el (bindat-test--sint):
* test/lisp/emacs-lisp/seq-tests.el (test-seq-drop-while)
(test-seq-take-while, test-seq-filter, test-seq-remove)
(test-seq-count, test-seq-some, test-seq-find, test-seq-every-p)
(test-seq-group-by):
* test/lisp/eshell/em-pred-tests.el (eshell-with-file-attributes-from-name):
* test/lisp/filenotify-tests.el (file-notify-test07-many-events)
(file-notify-test09-watched-file-in-watched-dir):
* test/src/floatfns-tests.el (bignum-expt, bignum-round):
* test/src/undo-tests.el (undo-test4): Prefer oddp/evenp to free-coding
them.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/floatfns-tests.el | 4 | ||||
| -rw-r--r-- | test/src/undo-tests.el | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 6820130a017..04ee97a6137 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -120,7 +120,7 @@ | |||
| 120 | -2 -1 0 1 2)) | 120 | -2 -1 0 1 2)) |
| 121 | (should (or (<= n 0) (= (expt 0 n) 0))) | 121 | (should (or (<= n 0) (= (expt 0 n) 0))) |
| 122 | (should (= (expt 1 n) 1)) | 122 | (should (= (expt 1 n) 1)) |
| 123 | (should (or (< n 0) (= (expt -1 n) (if (zerop (logand n 1)) 1 -1)))) | 123 | (should (or (< n 0) (= (expt -1 n) (if (evenp n) 1 -1)))) |
| 124 | (should (= (expt n 0) 1)) | 124 | (should (= (expt n 0) 1)) |
| 125 | (should (= (expt n 1) n)) | 125 | (should (= (expt n 1) n)) |
| 126 | (should (= (expt n 2) (* n n))) | 126 | (should (= (expt n 2) (* n n))) |
| @@ -167,7 +167,7 @@ | |||
| 167 | (should (if (zerop r) | 167 | (should (if (zerop r) |
| 168 | (= 0 cdelta fdelta rdelta) | 168 | (= 0 cdelta fdelta rdelta) |
| 169 | (or (/= cdelta fdelta) | 169 | (or (/= cdelta fdelta) |
| 170 | (zerop (% (round n d) 2))))))))))) | 170 | (evenp (round n d))))))))))) |
| 171 | 171 | ||
| 172 | (ert-deftest special-round () | 172 | (ert-deftest special-round () |
| 173 | (dolist (f '(ceiling floor round truncate)) | 173 | (dolist (f '(ceiling floor round truncate)) |
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el index 6150e09c52e..c0984c13ea6 100644 --- a/test/src/undo-tests.el +++ b/test/src/undo-tests.el | |||
| @@ -150,7 +150,7 @@ | |||
| 150 | (with-temp-buffer | 150 | (with-temp-buffer |
| 151 | (buffer-enable-undo) | 151 | (buffer-enable-undo) |
| 152 | (dotimes (i 1048576) | 152 | (dotimes (i 1048576) |
| 153 | (if (zerop (% i 2)) | 153 | (if (evenp i) |
| 154 | (insert "Evenses") | 154 | (insert "Evenses") |
| 155 | (insert "Oddses"))) | 155 | (insert "Oddses"))) |
| 156 | (undo-boundary) | 156 | (undo-boundary) |