both (+ 1 2) and 2 are stored in non-expanded form so they can be printed in the report in case the test fails. The trick used to do this does not work for byte compiled tests.
Two solutions that might work are
use more trickery in expect and save the original expression in the docstrings of the lambda functions.
stop using trickery in expect and use proper objects/structs instead.
First reported in https://github.com/jorgenschaefer/emacs-buttercup/issues/218#issuecomment-1151695407 .
For
expect
forms likeboth
(+ 1 2)
and2
are stored in non-expanded form so they can be printed in the report in case the test fails. The trick used to do this does not work for byte compiled tests.Two solutions that might work are