aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2014-11-06 01:02:20 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2014-11-06 01:02:20 +0800
commitb100546c9dd82a085d4b984275082a61fe3f3fe2 (patch)
tree08c6a65c3bc80b9ca486afbdfbd6e715db519446
parent834f8a1dc8b609199f84dcd59a885e77d8f770ba (diff)
downloaddexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.tar.gz
dexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.tar.zst
dexon-b100546c9dd82a085d4b984275082a61fe3f3fe2.zip
add test for Bytes.String()
-rw-r--r--ethutil/bytes_test.go11
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"