diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-12 03:04:03 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-12 03:04:03 +0800 |
commit | 12e8404f8fb0409c6db2a48ff4cc52c7aa81f72d (patch) | |
tree | d340bc04f8da519e8d3c3a982f935c4f4450bc5d | |
parent | 0d1cdd26d657f6559b52332e207e1cc9e7db7c67 (diff) | |
download | go-tangerine-12e8404f8fb0409c6db2a48ff4cc52c7aa81f72d.tar.gz go-tangerine-12e8404f8fb0409c6db2a48ff4cc52c7aa81f72d.tar.zst go-tangerine-12e8404f8fb0409c6db2a48ff4cc52c7aa81f72d.zip |
Fix TestBytestoNumber
-rw-r--r-- | ethutil/bytes_test.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ethutil/bytes_test.go b/ethutil/bytes_test.go index 358df9f83..d65336631 100644 --- a/ethutil/bytes_test.go +++ b/ethutil/bytes_test.go @@ -41,16 +41,17 @@ func (s *BytesSuite) TestNumberToBytes(c *checker.C) { } func (s *BytesSuite) TestBytesToNumber(c *checker.C) { - datasmall := []byte{0, 1} - datalarge := []byte{1, 2, 3} - expsmall := uint64(0) - explarge := uint64(0) - // TODO this fails. why? + datasmall := []byte{0xe9, 0x38, 0xe9, 0x38} + datalarge := []byte{0xe9, 0x38, 0xe9, 0x38, 0xe9, 0x38, 0xe9, 0x38} + + var expsmall uint64 = 0xe938e938 + var explarge uint64 = 0x0 + ressmall := BytesToNumber(datasmall) reslarge := BytesToNumber(datalarge) - c.Assert(ressmall, checker.DeepEquals, expsmall) - c.Assert(reslarge, checker.DeepEquals, explarge) + c.Assert(ressmall, checker.Equals, expsmall) + c.Assert(reslarge, checker.Equals, explarge) } |