forked from cerc-io/plugeth
Fix TestBytestoNumber
This commit is contained in:
parent
0d1cdd26d6
commit
12e8404f8f
@ -41,16 +41,17 @@ func (s *BytesSuite) TestNumberToBytes(c *checker.C) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *BytesSuite) TestBytesToNumber(c *checker.C) {
|
func (s *BytesSuite) TestBytesToNumber(c *checker.C) {
|
||||||
datasmall := []byte{0, 1}
|
datasmall := []byte{0xe9, 0x38, 0xe9, 0x38}
|
||||||
datalarge := []byte{1, 2, 3}
|
datalarge := []byte{0xe9, 0x38, 0xe9, 0x38, 0xe9, 0x38, 0xe9, 0x38}
|
||||||
expsmall := uint64(0)
|
|
||||||
explarge := uint64(0)
|
var expsmall uint64 = 0xe938e938
|
||||||
// TODO this fails. why?
|
var explarge uint64 = 0x0
|
||||||
|
|
||||||
ressmall := BytesToNumber(datasmall)
|
ressmall := BytesToNumber(datasmall)
|
||||||
reslarge := BytesToNumber(datalarge)
|
reslarge := BytesToNumber(datalarge)
|
||||||
|
|
||||||
c.Assert(ressmall, checker.DeepEquals, expsmall)
|
c.Assert(ressmall, checker.Equals, expsmall)
|
||||||
c.Assert(reslarge, checker.DeepEquals, explarge)
|
c.Assert(reslarge, checker.Equals, explarge)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user