diff --git a/os/gctx/gctx_z_unit_test.go b/os/gctx/gctx_z_unit_test.go index d989ca96c..2c62a44da 100644 --- a/os/gctx/gctx_z_unit_test.go +++ b/os/gctx/gctx_z_unit_test.go @@ -18,7 +18,7 @@ func Test_New(t *testing.T) { gtest.C(t, func(t *gtest.T) { ctx := gctx.New() t.AssertNE(ctx, nil) - t.Assert(gctx.CtxId(ctx), "") + t.AssertNE(gctx.CtxId(ctx), "") }) } @@ -26,7 +26,7 @@ func Test_WithCtx(t *testing.T) { gtest.C(t, func(t *gtest.T) { ctx := context.WithValue(context.TODO(), "TEST", 1) ctx = gctx.WithCtx(ctx) - t.Assert(gctx.CtxId(ctx), "") + t.AssertNE(gctx.CtxId(ctx), "") t.Assert(ctx.Value("TEST"), 1) }) } diff --git a/os/glog/glog_z_unit_test.go b/os/glog/glog_z_unit_test.go index 054e75a44..548442718 100644 --- a/os/glog/glog_z_unit_test.go +++ b/os/glog/glog_z_unit_test.go @@ -13,7 +13,6 @@ import ( "testing" "github.com/gogf/gf/v2/frame/g" - "github.com/gogf/gf/v2/os/gctx" "github.com/gogf/gf/v2/os/gfile" "github.com/gogf/gf/v2/os/glog" "github.com/gogf/gf/v2/os/gtime" @@ -55,16 +54,6 @@ func Test_Ctx_Config(t *testing.T) { }) } -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.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) - }) -} - func Test_Concurrent(t *testing.T) { gtest.C(t, func(t *gtest.T) { c := 1000