mirror of https://github.com/status-im/op-geth.git
add test for Bytes.String()
This commit is contained in:
parent
834f8a1dc8
commit
b100546c9d
|
@ -5,6 +5,17 @@ import (
|
||||||
"testing"
|
"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) {
|
func TestParseDataString(t *testing.T) {
|
||||||
data := ParseData("hello", "world", "0x0106")
|
data := ParseData("hello", "world", "0x0106")
|
||||||
exp := "68656c6c6f000000000000000000000000000000000000000000000000000000776f726c640000000000000000000000000000000000000000000000000000000106000000000000000000000000000000000000000000000000000000000000"
|
exp := "68656c6c6f000000000000000000000000000000000000000000000000000000776f726c640000000000000000000000000000000000000000000000000000000106000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
|
Loading…
Reference in New Issue