From 73d3f1b84eb7f315469b4cb77846304efa8162d6 Mon Sep 17 00:00:00 2001 From: ngaut Date: Wed, 14 Oct 2015 17:33:58 +0800 Subject: [PATCH 1/2] sessionctx: Rename sessionctx_test.go to domainctx_test.go Currently sessionctx_test.go is test file for domainctx --- sessionctx/sessionctx_test.go | 44 ----------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 sessionctx/sessionctx_test.go diff --git a/sessionctx/sessionctx_test.go b/sessionctx/sessionctx_test.go deleted file mode 100644 index a4d6e7fe9b..0000000000 --- a/sessionctx/sessionctx_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package sessionctx - -import ( - "testing" - - . "github.com/pingcap/check" - "github.com/pingcap/tidb/util/mock" -) - -func TestT(t *testing.T) { - TestingT(t) -} - -var _ = Suite(&testSessionCtxSuite{}) - -type testSessionCtxSuite struct { -} - -func (s *testSessionCtxSuite) TestDomain(c *C) { - ctx := mock.NewContext() - - c.Assert(domainKey.String(), Not(Equals), "") - - BindDomain(ctx, nil) - v := GetDomain(ctx) - c.Assert(v, IsNil) - - ctx.ClearValue(domainKey) - v = GetDomain(ctx) - c.Assert(v, IsNil) -} From 4d1532c0b820d6d9287e6cd080e2ef43b2c4dd7a Mon Sep 17 00:00:00 2001 From: ngaut Date: Wed, 14 Oct 2015 17:37:05 +0800 Subject: [PATCH 2/2] Add missing file --- sessionctx/domainctx_test.go | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sessionctx/domainctx_test.go diff --git a/sessionctx/domainctx_test.go b/sessionctx/domainctx_test.go new file mode 100644 index 0000000000..a4d6e7fe9b --- /dev/null +++ b/sessionctx/domainctx_test.go @@ -0,0 +1,44 @@ +// Copyright 2015 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// See the License for the specific language governing permissions and +// limitations under the License. + +package sessionctx + +import ( + "testing" + + . "github.com/pingcap/check" + "github.com/pingcap/tidb/util/mock" +) + +func TestT(t *testing.T) { + TestingT(t) +} + +var _ = Suite(&testSessionCtxSuite{}) + +type testSessionCtxSuite struct { +} + +func (s *testSessionCtxSuite) TestDomain(c *C) { + ctx := mock.NewContext() + + c.Assert(domainKey.String(), Not(Equals), "") + + BindDomain(ctx, nil) + v := GetDomain(ctx) + c.Assert(v, IsNil) + + ctx.ClearValue(domainKey) + v = GetDomain(ctx) + c.Assert(v, IsNil) +}