Commit 0d1cdd26 authored by Taylor Gerring's avatar Taylor Gerring

Update TestNumberToBytes

parent cff0d931
...@@ -28,16 +28,17 @@ func (s *BytesSuite) TestDeleteFromByteSlice(c *checker.C) { ...@@ -28,16 +28,17 @@ func (s *BytesSuite) TestDeleteFromByteSlice(c *checker.C) {
} }
} }
*/
func (s *BytesSuite) TestNumberToBytes(c *checker.C) { func (s *BytesSuite) TestNumberToBytes(c *checker.C) {
data := int(1) // data1 := int(1)
exp := []byte{0, 0, 0, 0, 0, 0, 0, 1} // res1 := NumberToBytes(data1, 16)
// TODO this fails. why? // c.Check(res1, checker.Panics)
res := NumberToBytes(data, 16)
if bytes.Compare(res, exp) != 0 { var data2 float64 = 3.141592653
t.Errorf("Expected % x Got % x", exp, res) exp2 := []byte{0xe9, 0x38}
} res2 := NumberToBytes(data2, 16)
c.Assert(res2, checker.DeepEquals, exp2)
} }
*/
func (s *BytesSuite) TestBytesToNumber(c *checker.C) { func (s *BytesSuite) TestBytesToNumber(c *checker.C) {
datasmall := []byte{0, 1} datasmall := []byte{0, 1}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment