On Sun, 3 Jan 2021, Sven Schreiber wrote:
Am 03.01.2021 um 17:30 schrieb Sven Schreiber:
> Hi,
> (with the latest snapshot) I wonder if I'm missing something:
>
> ? eval assert(1==0)
> 1
>
> To be totally explicit, I was expecting 0 given the obvious falsehood of
> 1 and 0 being equal.
OK, I have looked at do_assert in lib/src/geneval.c. There we have:
if (assert_val == 0) {
ret->v.xval = 1;
which means that the return value will always be 1 if the assert warning
level is set to off (zero). Is this really the supposed design?
Also, further down I think there may be another bug. No return value is
assigned if the warning level is at least 1 and the expression is
actually true. And indeed I get:
? set assert warn
? eval assert(1==1)
NA
At least not a very subtle bug!
OK, both those points are fixed in git.
Allin