Subject: Re: 27.0.90; Can't run ERT tests for edebugged generator functions

From: Philipp Stephani <[email-masked]>
Date: Wed, 10 Jun 2020 13:28:01 +0200

Am Sa., 4. Apr. 2020 um 18:57 Uhr schrieb Philipp Stephani
<[email-masked]>:
>
>
> Insert into *scratch*:
>
> (require 'generator)
> (require 'ert)
> (iter-defun foo () (iter-yield 123))
> (ert-deftest foo () (should (equal (iter-next (foo)) 123)))
>
> Evaluate the first two forms.  Edebug the third form (C-u C-M-x).
> Evaluate the fourth form.  Then run the test using M-x ert RET RET.
> The test will reach `foo', then just hit space to continue.  The test
> will then fail with
>
> F foo
>     (void-function cps-internal-yield)

I think none of the macros in generator.el should use the 'body' or
'def-body' or 't' debug specifications. Generator functions don't
really have bodies in the edebug sense, as the CPS machinery rewrites
them completely. So probably these should all use 'form' for now,
until edebug grows functionality to instrument such functions.