aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-06-29 12:08:24 +0200
committerAndrea Corallo2020-01-01 11:33:47 +0100
commit5202f742b0f5f0a5c317d66a8ce6a8e84e86dffc (patch)
tree88df71956fa1a13ffd064691a52ed234684ebc8e /test/src
parent34b3dac89ed681aa09b4d6b0e381504aa3adeb58 (diff)
downloademacs-5202f742b0f5f0a5c317d66a8ce6a8e84e86dffc.tar.gz
emacs-5202f742b0f5f0a5c317d66a8ce6a8e84e86dffc.zip
add setcar
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 31b2f0f001e..8fd3ca2e197 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -313,12 +313,20 @@
313 (defun comp-tests-consp-f (x) 313 (defun comp-tests-consp-f (x)
314 ;; Bconsp 314 ;; Bconsp
315 (consp x)) 315 (consp x))
316 (defun comp-tests-car-f (x)
317 ;; Bsetcar
318 (setcar x 3))
316 319
317 (byte-compile #'comp-tests-consp-f) 320 (byte-compile #'comp-tests-consp-f)
318 (native-compile #'comp-tests-consp-f) 321 (native-compile #'comp-tests-consp-f)
322 (byte-compile #'comp-tests-car-f)
323 (native-compile #'comp-tests-car-f)
319 324
320 (should (eq (comp-tests-consp-f '(1)) t)) 325 (should (eq (comp-tests-consp-f '(1)) t))
321 (should (eq (comp-tests-consp-f 1) nil))) 326 (should (eq (comp-tests-consp-f 1) nil))
327 (let ((x (cons 1 2)))
328 (should (= (comp-tests-car-f x) 3))
329 (should (equal x '(3 . 2)))))
322 330
323(ert-deftest comp-tests-num-inline () 331(ert-deftest comp-tests-num-inline ()
324 "Test some inlined number functions." 332 "Test some inlined number functions."