diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-12 00:37:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-12 00:37:17 +0800 |
commit | 239e17de126a3d7afa29da7ee423ffc79757877f (patch) | |
tree | e2f844a7b2a1ad88010745449863aa6f1cc14da4 /rpc/util_test.go | |
parent | 61bf29be36a6678ba16c457229ca306339ea4ebc (diff) | |
parent | c01d4c2f4c8704656e407ab4d80d9ec82e016731 (diff) | |
download | dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.gz dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.zst dexon-239e17de126a3d7afa29da7ee423ffc79757877f.zip |
Merge branch 'rpcfrontier' into develop
Diffstat (limited to 'rpc/util_test.go')
-rw-r--r-- | rpc/util_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rpc/util_test.go b/rpc/util_test.go new file mode 100644 index 000000000..b0a4979b5 --- /dev/null +++ b/rpc/util_test.go @@ -0,0 +1,25 @@ +package rpc + +import ( + "bytes" + "testing" +) + +//fromHex +func TestFromHex(t *testing.T) { + input := "0x01" + expected := []byte{1} + result := fromHex(input) + if bytes.Compare(expected, result) != 0 { + t.Errorf("Expected % x got % x", expected, result) + } +} + +func TestFromHexOddLength(t *testing.T) { + input := "0x1" + expected := []byte{1} + result := fromHex(input) + if bytes.Compare(expected, result) != 0 { + t.Errorf("Expected % x got % x", expected, result) + } +} |