aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGemini Lasswell2017-09-26 08:14:23 -0700
committerGemini Lasswell2017-10-08 16:13:39 -0700
commit3c2e8eff8cc9a4a535f473b3e150cb056d8f891d (patch)
tree730be0a589aa785ebcbb48886d7d2c62afa77843 /test
parentd79cf638f278e50c22feb53d6ba556f5ce9d7853 (diff)
downloademacs-3c2e8eff8cc9a4a535f473b3e150cb056d8f891d.tar.gz
emacs-3c2e8eff8cc9a4a535f473b3e150cb056d8f891d.zip
Stop Testcover from producing spurious 1value errors
Fix bug#25351 by copying results of form evaluations for later comparison. * lisp/emacs-lisp/testcover.el (testcover-after): Copy the result of a form's first evaluation and compare subsequent evaluations to the copy. Improve the error message used when a form's value changes. (testcover--copy-object, testcover--copy-object1): New functions. * test/lisp/emacs-lisp/testcover-resources/testcases.el (by-value-vs-by-reference-bug-25351): Remove expected failure tag. (circular-lists-bug-24402): Add another circular list case.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/testcover-resources/testcases.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/lisp/emacs-lisp/testcover-resources/testcases.el b/test/lisp/emacs-lisp/testcover-resources/testcases.el
index d8b8192748d..6a9612db05a 100644
--- a/test/lisp/emacs-lisp/testcover-resources/testcases.el
+++ b/test/lisp/emacs-lisp/testcover-resources/testcases.el
@@ -357,7 +357,6 @@
357 357
358;; ==== by-value-vs-by-reference-bug-25351 ==== 358;; ==== by-value-vs-by-reference-bug-25351 ====
359"An object created by a 1value expression may be modified by other code." 359"An object created by a 1value expression may be modified by other code."
360:expected-result :failed
361;; ==== 360;; ====
362(defun testcover-testcase-ab () 361(defun testcover-testcase-ab ()
363 (list 'a 'b)) 362 (list 'a 'b))
@@ -491,10 +490,18 @@ regarding the odd-looking coverage result for the quoted form."
491"Testcover captures and ignores circular list errors." 490"Testcover captures and ignores circular list errors."
492;; ==== 491;; ====
493(defun testcover-testcase-cyc1 (a) 492(defun testcover-testcase-cyc1 (a)
494 (let ((ls (make-list 10 a%%%))) 493 (let ((ls (make-list 10 a%%%)%%%))
495 (nconc ls ls) 494 (nconc ls%%% ls%%%)
496 ls)) 495 ls)) ; The lack of a mark here is due to an ignored circular list error.
497(testcover-testcase-cyc1 1) 496(testcover-testcase-cyc1 1)
498(testcover-testcase-cyc1 1) 497(testcover-testcase-cyc1 1)
498(defun testcover-testcase-cyc2 (a b)
499 (let ((ls1 (make-list 10 a%%%)%%%)
500 (ls2 (make-list 10 b)))
501 (nconc ls2 ls2)
502 (nconc ls1%%% ls2)
503 ls1))
504(testcover-testcase-cyc2 1 2)
505(testcover-testcase-cyc2 1 4)
499 506
500;; testcases.el ends here. 507;; testcases.el ends here.