• David Lazar's avatar
    io: correctly compute call depth in test · 46ecac99
    David Lazar authored
    TestMultiReaderFlatten determines the call depth by counting PCs
    returned by runtime.Callers. With inlining, this is incorrect because
    a PC can represent multiple calls. Furthermore, runtime.Callers might
    return an additional "skip" PC, which does not represent a real call.
    This modifies the test to use CallersFrames to determine the call depth.
    Now the test passes with -l=4.
    
    Change-Id: I284f3b1e0b2d194bd08c230c616914503e5a370d
    Reviewed-on: https://go-review.googlesource.com/40990
    Run-TryBot: David Lazar <lazard@golang.org>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    46ecac99
Name
Last commit
Last update
..
ioutil Loading commit data...
example_test.go Loading commit data...
io.go Loading commit data...
io_test.go Loading commit data...
multi.go Loading commit data...
multi_test.go Loading commit data...
pipe.go Loading commit data...
pipe_test.go Loading commit data...