log: add test of Caller
New regexp in log test is picky and will require some
maintenance, but it catches off-by-one mistakes too.
Fixes #710.
R=gri
CC=esko.luontola, golang-dev
https://golang.org/cl/887043
Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`
Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`
Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`
- Rline = `[0-9]+:`
+ Rline = `(58|60):` // must update if the calls to l.Logf / l.Log below move
Rlongfile = `.*/[A-Za-z0-9_\-]+\.go:` + Rline
Rshortfile = `[A-Za-z0-9_\-]+\.go:` + Rline
)
{
Func *f;
- if(callers(skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
+ if(callers(1+skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
retfile = emptystring;
retline = 0;
retbool = false;