Commit 0508045e authored by Noam Postavsky's avatar Noam Postavsky
Browse files

Don't error on circular values in testcover

* lisp/emacs-lisp/testcover.el (testcover-after, testcover-1value):
Consider circular lists to be non-equal instead of signaling error.
parent 95a04fd2
......@@ -463,7 +463,10 @@ binding `testcover-vector' to the code-coverage vector for TESTCOVER-SYM
(cond
((eq (aref testcover-vector idx) 'unknown)
(aset testcover-vector idx val))
((not (equal (aref testcover-vector idx) val))
((not (condition-case ()
(equal (aref testcover-vector idx) val)
;; TODO: Actually check circular lists for equality.
(circular-list nil)))
(aset testcover-vector idx 'ok-coverage)))
val)
......@@ -475,7 +478,10 @@ same value during coverage testing."
((eq (aref testcover-vector idx) '1value)
(aset testcover-vector idx (cons '1value val)))
((not (and (eq (car-safe (aref testcover-vector idx)) '1value)
(equal (cdr (aref testcover-vector idx)) val)))
(condition-case ()
(equal (cdr (aref testcover-vector idx)) val)
;; TODO: Actually check circular lists for equality.
(circular-list nil))))
(error "Value of form marked with `1value' does vary: %s" val)))
val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment