diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-12 03:03:50 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-12 03:03:50 +0800 |
commit | 0d1cdd26d657f6559b52332e207e1cc9e7db7c67 (patch) | |
tree | f01e48e7009ae3efcbef22dd3ad58bb75b5d1e37 | |
parent | cff0d93105956d716d32535af64ad3154f1628ae (diff) | |
download | go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar.gz go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar.bz2 go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar.lz go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar.xz go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.tar.zst go-tangerine-0d1cdd26d657f6559b52332e207e1cc9e7db7c67.zip |
Update TestNumberToBytes
-rw-r--r-- | ethutil/bytes_test.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ethutil/bytes_test.go b/ethutil/bytes_test.go index f334c4f57..358df9f83 100644 --- a/ethutil/bytes_test.go +++ b/ethutil/bytes_test.go @@ -28,16 +28,17 @@ func (s *BytesSuite) TestDeleteFromByteSlice(c *checker.C) { } } +*/ func (s *BytesSuite) TestNumberToBytes(c *checker.C) { - data := int(1) - exp := []byte{0, 0, 0, 0, 0, 0, 0, 1} - // TODO this fails. why? - res := NumberToBytes(data, 16) - if bytes.Compare(res, exp) != 0 { - t.Errorf("Expected % x Got % x", exp, res) - } + // data1 := int(1) + // res1 := NumberToBytes(data1, 16) + // c.Check(res1, checker.Panics) + + var data2 float64 = 3.141592653 + exp2 := []byte{0xe9, 0x38} + res2 := NumberToBytes(data2, 16) + c.Assert(res2, checker.DeepEquals, exp2) } -*/ func (s *BytesSuite) TestBytesToNumber(c *checker.C) { datasmall := []byte{0, 1} |