Closed navytux closed 6 years ago
Instead of copy-pasting full test driver for each value, make it to be only one test with many values in table each tested by common driver.
TestZeroLengthData was checking output.BitLen() == 0 which is another way to test for equality with big.Int(0) according to
https://golang.org/pkg/math/big/#Int.BitLen
So join it too to the rest of decodeLong tests.
While at decodeLong topic, rename BenchmarkSpeed -> BenchmarkDecodeLong as this benchmark checks speed of decodeLong only, nothing else.
Much better, thanks.
Thanks
Instead of copy-pasting full test driver for each value, make it to be only one test with many values in table each tested by common driver.
TestZeroLengthData was checking output.BitLen() == 0 which is another way to test for equality with big.Int(0) according to
So join it too to the rest of decodeLong tests.
While at decodeLong topic, rename BenchmarkSpeed -> BenchmarkDecodeLong as this benchmark checks speed of decodeLong only, nothing else.