Skip to content

Instantly share code, notes, and snippets.

@morgo
Created August 9, 2018 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morgo/27673c86f1368aa8f20755f91b425316 to your computer and use it in GitHub Desktop.
Save morgo/27673c86f1368aa8f20755f91b425316 to your computer and use it in GitHub Desktop.
Adding tests..
morgo@ryzen:~/go/src/github.com/pingcap/tidb$ git diff
diff --git a/util/charset/charset_test.go b/util/charset/charset_test.go
index c400d97f..931b78ac 100644
--- a/util/charset/charset_test.go
+++ b/util/charset/charset_test.go
@@ -17,6 +17,8 @@ import (
"testing"
. "github.com/pingcap/check"
+ "github.com/pingcap/tidb/store/mockstore"
+ "github.com/pingcap/tidb/util/testkit"
"github.com/pingcap/tidb/util/testleak"
)
@@ -28,6 +30,7 @@ func TestT(t *testing.T) {
var _ = Suite(&testCharsetSuite{})
type testCharsetSuite struct {
+ store kv.Storage
}
func testValidCharset(c *C, charset string, collation string, expect bool) {
@@ -92,3 +95,10 @@ func (s *testCharsetSuite) TestGetDefaultCollation(c *C) {
testGetDefaultCollation(c, tt.cs, tt.co, tt.succ)
}
}
+
+func (s *testCharsetSuite) TestConvertCharsetSQL(c *C) {
+
+ tk := testkit.NewTestKit(c, s.store)
+ tk.MustExec("SELECT CONVERT( CONVERT( 'xxx' USING ascii ) USING utf8mb4 ) AS xxx")
+
+}
morgo@ryzen:~/go/src/github.com/pingcap/tidb$ make dev
..
..
# github.com/pingcap/tidb/util/charset
import cycle not allowed in test
package github.com/pingcap/tidb/util/charset (test)
imports github.com/pingcap/tidb/store/mockstore
imports github.com/pingcap/tidb/store/mockstore/mocktikv
imports github.com/pingcap/tidb/ast
imports github.com/pingcap/tidb/model
imports github.com/pingcap/tidb/types
imports github.com/pingcap/tidb/util/charset
FAIL github.com/pingcap/tidb/util/charset [setup failed]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment