aboutsummaryrefslogtreecommitdiff
path: root/src/testing/iotest/reader_test.go
AgeCommit message (Collapse)Author
2022-09-07testing: use strings.Buildercuiweixie
Change-Id: Ied8a3019f1e21c0e74c798d2b1b279a606a38554 Reviewed-on: https://go-review.googlesource.com/c/go/+/428279 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-10-20testing/iotest: add TestReader to test readersRuss Cox
There are many reader behaviors that are subtle and worth testing, and it's nice to have one complete tester instead of many incomplete ones. For #41190, which will use this as part of a larger file system implementation tester. Change-Id: Ib4cc7fae94b0d9b45dfacadc52baa77ad3761322 Reviewed-on: https://go-review.googlesource.com/c/go/+/243909 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-08-18testing/iotest: correct ErrReader signature and remove exported errorEmmanuel T Odeke
Corrects ErrReader's signature to what was accepted in the approved proposal, and also removes an exported ErrIO which wasn't part of the proposal and is unnecessary. The new signature allows users to customize their own errors. While here, started examples, with ErrReader leading the way. Updates #38781 Change-Id: Ia7f84721f11061343cfef8b1adc2b7b69bc3f43c Reviewed-on: https://go-review.googlesource.com/c/go/+/248898 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-08-17testing/iotest: add ErrReaderCarlos Alexandro Becker
Adds an io.Reader that always returns 0 and a non-nil error. Fixes #38781 Change-Id: I56bd124de07bc8809e77c6cfaab33a1e32cfe2ee GitHub-Last-Rev: 4e232b17e9120405d4ea4743350ee361a3505043 GitHub-Pull-Request: golang/go#34741 Reviewed-on: https://go-review.googlesource.com/c/go/+/199501 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-11-05testing/iotest: add missing testsPantelis Sampaziotis
Adds missing tests for all the types: * OneByteReader * HalfReader * DataErrReader * TimeoutReader * TruncateWriter * writeLogger * readLogger Fixes #33650 Change-Id: I1c773f9f1625ff33a1d0b5a045c72a73a9eca9ce GitHub-Last-Rev: 2ab650677bb9cad43ea2ce620c9898123c7ec396 GitHub-Pull-Request: golang/go#33651 Reviewed-on: https://go-review.googlesource.com/c/go/+/190259 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>