]> Cypherpunks repositories - gostls13.git/commit
archive/tar: expand abilities of TestReader
authorJoe Tsai <joetsai@digital-static.net>
Thu, 1 Oct 2015 09:59:49 +0000 (02:59 -0700)
committerAndrew Gerrand <adg@golang.org>
Tue, 6 Oct 2015 05:06:58 +0000 (05:06 +0000)
commitcfb116d4538dcf2455ca59e786396c779019c065
tree16a39ca8cfa980097573d284087daf04b9cb3c3d
parent710b9ad61709043d55d94a0ca28f14cb5739a171
archive/tar: expand abilities of TestReader

Motivation:
* There are an increasing number of "one-off" corrupt files added
to make sure that package does not succeed or crash on them.
Instead, allow for the test to specify the error that is expected
to occur (if any).
* Also, fold in the logic to check the MD5 checksum into this
function.

The following tests are being removed:
* TestIncrementalRead: Done by TestReader by using io.CopyBuffer
with a buffer of 8. This achieves the same behavior as this test.
* TestSparseEndToEnd: Since TestReader checks the MD5 checksums
if the input corpus provides them, then this is redundant.
* TestSparseIncrementalRead: Redundant for the same reasons that
TestIncrementalRead is now redundant
* TestNegativeHdrSize: Added to TestReader corpus
* TestIssue10968: Added to TestReader corpus
* TestIssue11169: Added to TestReader corpus

With this change, code coverage did not change: 85.3%

Change-Id: I8550d48657d4dbb8f47dfc3dc280758ef73b47ec
Reviewed-on: https://go-review.googlesource.com/15176
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/archive/tar/reader_test.go