1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:24:42 -07:00
go/src/io
David Lazar 46ecac99fb io: correctly compute call depth in test
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: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-18 19:56:54 +00:00
..
ioutil io/ioutil: make TestTempFile more robust 2017-04-17 19:45:37 +00:00
example_test.go
io_test.go
io.go io: update documentation on LimitedReader 2016-12-09 23:19:06 +00:00
multi_test.go io: correctly compute call depth in test 2017-04-18 19:56:54 +00:00
multi.go
pipe_test.go io: fix PipeWriter.Close to wake up Writes 2016-12-21 15:08:26 +00:00
pipe.go io: fix PipeWriter.Close to wake up Writes 2016-12-21 15:08:26 +00:00