]> Cypherpunks repositories - gostls13.git/commit
compress/bzip2: refactor unit tests
authorJoe Tsai <joetsai@digital-static.net>
Wed, 2 Mar 2016 20:21:53 +0000 (12:21 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 3 Mar 2016 02:53:34 +0000 (02:53 +0000)
commit8a83d36b8e4aeed56f85e6b26832b6a7ed8951a5
tree61cf7151ed28209b000c76356f876a708ad8bda6
parentfcb23249b2ac65a882fdbbeeb907fdbb5dffdb79
compress/bzip2: refactor unit tests

Over the years as more bugs were discovered with the bzip2 library,
new Tests were appended the unit tests and the tests became gnarly.

Clean up the tests to be more consistent with modern Go style in
addition to coalescing common tests into a general version that
iterates over a list of input/output pairs. This has the advantage that
the input, output, and test code are all in the same area, rather than
being sprawled around the test file.

There is no loss of test coverage.

Change-Id: I377ed89378f0b89763d4a56ffc37b22d9c2a369e
Reviewed-on: https://go-review.googlesource.com/20133
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/compress/bzip2/bzip2_test.go
src/compress/bzip2/testdata/fail-issue5747.bz2 [new file with mode: 0644]
src/compress/bzip2/testdata/pass-random1.bin [new file with mode: 0644]
src/compress/bzip2/testdata/pass-random1.bz2 [new file with mode: 0644]
src/compress/bzip2/testdata/pass-random2.bin [new file with mode: 0644]
src/compress/bzip2/testdata/pass-random2.bz2 [new file with mode: 0644]
src/compress/bzip2/testdata/pass-sawtooth.bz2 [new file with mode: 0644]