fix unit testing cases

This commit is contained in:
John Guo
2021-10-11 21:53:16 +08:00
parent 54dd11f511
commit 7eb3b32b26
2 changed files with 6 additions and 6 deletions

View File

@ -237,7 +237,7 @@ func Test_StructType(t *testing.T) {
}
r, err := structs.StructType(new(A))
t.AssertNil(err)
t.Assert(r.Signature(), `github.com/gogf/gf/internal/structs_test/structs_test.A`)
t.Assert(r.Signature(), `github.com/gogf/gf/v2/internal/structs_test/structs_test.A`)
})
gtest.C(t, func(t *gtest.T) {
type B struct {
@ -248,7 +248,7 @@ func Test_StructType(t *testing.T) {
}
r, err := structs.StructType(new(A).B)
t.AssertNil(err)
t.Assert(r.Signature(), `github.com/gogf/gf/internal/structs_test/structs_test.B`)
t.Assert(r.Signature(), `github.com/gogf/gf/v2/internal/structs_test/structs_test.B`)
})
gtest.C(t, func(t *gtest.T) {
type B struct {
@ -285,7 +285,7 @@ func Test_StructTypeBySlice(t *testing.T) {
}
r, err := structs.StructType(new(A).Array)
t.AssertNil(err)
t.Assert(r.Signature(), `github.com/gogf/gf/internal/structs_test/structs_test.B`)
t.Assert(r.Signature(), `github.com/gogf/gf/v2/internal/structs_test/structs_test.B`)
})
gtest.C(t, func(t *gtest.T) {
type B struct {
@ -296,7 +296,7 @@ func Test_StructTypeBySlice(t *testing.T) {
}
r, err := structs.StructType(new(A).Array)
t.AssertNil(err)
t.Assert(r.Signature(), `github.com/gogf/gf/internal/structs_test/structs_test.B`)
t.Assert(r.Signature(), `github.com/gogf/gf/v2/internal/structs_test/structs_test.B`)
})
gtest.C(t, func(t *gtest.T) {
type B struct {
@ -307,7 +307,7 @@ func Test_StructTypeBySlice(t *testing.T) {
}
r, err := structs.StructType(new(A).Array)
t.AssertNil(err)
t.Assert(r.Signature(), `github.com/gogf/gf/internal/structs_test/structs_test.B`)
t.Assert(r.Signature(), `github.com/gogf/gf/v2/internal/structs_test/structs_test.B`)
})
}

View File

@ -55,7 +55,7 @@ func Test_Ctx_CtxKey(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
w := bytes.NewBuffer(nil)
l := glog.NewWithWriter(w)
l.Print(gctx.WithValue(context.TODO(), "abcdefg"), 1, 2, 3)
l.Print(gctx.WithCtxId(context.TODO(), "abcdefg"), 1, 2, 3)
t.Assert(gstr.Count(w.String(), "abcdefg"), 1)
t.Assert(gstr.Count(w.String(), "1 2 3"), 1)
})