• Kirill Smelkov's avatar
    decoder: Cleanup decodeLong tests (#43) · 9eb8c4c6
    Kirill Smelkov authored
    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.
    9eb8c4c6
ogorek_test.go 19.2 KB