Browse Source

增加单元测试文件

master v0.1.2
guzeng 3 years ago
parent
commit
50d659d4b3
2 changed files with 14 additions and 6 deletions
  1. +8
    -0
      go.sum
  2. +6
    -6
      user.client_test.go

+ 8
- 0
go.sum View File

@ -0,0 +1,8 @@
github.com/chai2010/protorpc v1.0.0 h1:aJ45G9sl1utSKo35EqnBSTs5jqTpdJDJAuZMMYPAtFo=
github.com/chai2010/protorpc v1.0.0/go.mod h1:woR3WwjaQDqFjlzdVsFEKiK5Ur12QL8mYxVPjfr5z54=
github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ=
github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

+ 6
- 6
user.client_test.go View File

@ -12,14 +12,14 @@ func Test_GetUserByToken(t *testing.T) {
t.Log(res["UserId"])
t.Log(err)
res, err = GetUserByUsername(dbname, "tetele")
t.Log(res)
t.Log(res["UserId"])
res2, err := GetUserByUsername(dbname, "tetele")
t.Log(res2)
t.Log(res2.GetUserId())
t.Log(err)
res, err = GetUserByUsercode(dbname, "2233")
t.Log(res)
t.Log(res["UserId"])
res3, err := GetUserByUsercode(dbname, "2233")
t.Log(res3)
t.Log(*res3.UserId)
t.Log(err)
}


Loading…
Cancel
Save