Skip to content

Commit

Permalink
modify common test
Browse files Browse the repository at this point in the history
  • Loading branch information
geekres committed Aug 21, 2019
1 parent f289937 commit 725db89
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions common/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package common
import (
"encoding/json"
"fmt"
"reflect"
"regexp"
"testing"
)
Expand Down Expand Up @@ -167,3 +168,20 @@ func TestIsChildren1(t *testing.T) {
}

}

func TestConver(t *testing.T) {
myname := []byte("myname")
name := BytesToName(myname)
if reflect.TypeOf(name).String() != "common.Name" {
t.Errorf("type conver error")
}

myname1 := "myname1"
name.SetString(myname1)

bname := name.Big()
if BigToName(bname) != Name(myname1) {
t.Errorf("conver error")
}

}

0 comments on commit 725db89

Please sign in to comment.