bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25471: 26.0.50; Edebug and Testcover give incorrect code coverage re


From: Lars Ingebrigtsen
Subject: bug#25471: 26.0.50; Edebug and Testcover give incorrect code coverage results for code that uses 'unknown
Date: Sat, 27 Jul 2019 12:30:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Gemini Lasswell <gazally@runbox.com> writes:

> If you use Edebug or Testcover to gather code coverage information on
> code which uses the symbol `unknown', you will get incorrect code
> coverage results, because Edebug uses `unknown' internally to represent
> forms which have never been evaluated under Edebug.

I've now fixed this in edebug.el on the trunk.

> For an example of incorrect code coverage, save this function definition
> in a file called bug.el:
>
> (defun how-do-i-know-you (name)
>   (let ((val 'unknown))
>     (when (equal name "Bob")
>       (setq val 'known))
>     val))
>
> And then use:
>
> M-x testcover-start RET bug.el RET
> M-: (how-do-i-know-you "Liz") RET
> M-x testcover-mark-all RET RET

However, the testcover case seems to be more complicated.  `unknown'
seems straightforward, but there's also `1value' and `maybe' and perhaps
some other symbols that I'm not sure need this or not.  `noreturn', for
instance, seems part of the official API and can't be changed...  I
think?

I don't use testcover myself.  Could you perhaps propose a patch to fix
this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]