From b100546c9dd82a085d4b984275082a61fe3f3fe2 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Wed, 5 Nov 2014 18:02:20 +0100 Subject: [PATCH] add test for Bytes.String() --- ethutil/bytes_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ethutil/bytes_test.go b/ethutil/bytes_test.go index 361df4b9d9..82167f0541 100644 --- a/ethutil/bytes_test.go +++ b/ethutil/bytes_test.go @@ -5,6 +5,17 @@ import ( "testing" ) +func TestByteString(t *testing.T) { + var data Bytes + data = []byte{102, 111, 111} + exp := "foo" + res := data.String() + + if res != exp { + t.Errorf("Expected %s got %s", exp, res) + } +} + func TestParseDataString(t *testing.T) { data := ParseData("hello", "world", "0x0106") exp := "68656c6c6f000000000000000000000000000000000000000000000000000000776f726c640000000000000000000000000000000000000000000000000000000106000000000000000000000000000000000000000000000000000000000000"