Re: assert with formatting
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: assert with formatting
 
- From: Luiz Henrique de Figueiredo <lhf@...>
 
- Date: 2018年7月12日 20:43:13 -0300
 
> Of course I could write a wrapper function which takes varargs compiles the
> string and run assert on that.
See http://lua-users.org/lists/lua-l/2010-05/msg00494.html
> However, when hooking up to the debugger it will always report the assert in
> the helper function as a
> location instead of the location in the unittest which is broken. It's
> obviously still available in the
> callstack, but it would be nicer the other way.
For that, you'll have to redefine assert to call error with the
correct stack level.