diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-06 01:02:20 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2014-11-06 01:02:20 +0800 |
commit | b100546c9dd82a085d4b984275082a61fe3f3fe2 (patch) | |
tree | 08c6a65c3bc80b9ca486afbdfbd6e715db519446 | |
parent | 834f8a1dc8b609199f84dcd59a885e77d8f770ba (diff) | |
download | dexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.tar.gz dexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.tar.zst dexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.zip |
add test for Bytes.String()
-rw-r--r-- | ethutil/bytes_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ethutil/bytes_test.go b/ethutil/bytes_test.go index 361df4b9d..82167f054 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" |