Skip to content

Commit

Permalink
parser: Remove useless code
Browse files Browse the repository at this point in the history
Address comment
  • Loading branch information
shenli committed Sep 7, 2015
1 parent 84b2a6b commit 8663db2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,23 +288,21 @@ func (s *testParserSuite) TestParser0(c *C) {
src := "SELECT id+?, id+? from t;"
l := NewLexer(src)
l.SetPrepare()
ok := yyParse(l) == 0
c.Assert(ok, Equals, true)
c.Assert(yyParse(l), Equals, 0)
c.Assert(len(l.ParamList), Equals, 2)
c.Assert(len(l.Stmts()), Equals, 1)

// Testcase for -- Comment and unary -- operator
src = "CREATE TABLE foo (a SMALLINT UNSIGNED, b INT UNSIGNED,); -- foo\nSelect --1 from foo;"
l = NewLexer(src)
l.SetPrepare()
ok = yyParse(l) == 0
c.Assert(ok, Equals, true)
c.Assert(yyParse(l), Equals, 0)
c.Assert(len(l.Stmts()), Equals, 2)

// Testcase for CONVERT(expr,type)
src = "SELECT CONVERT('111', SIGNED);"
l = NewLexer(src)
ok = yyParse(l) == 0
c.Assert(yyParse(l), Equals, 0)
st := l.Stmts()[0]
ss, ok := st.(*stmts.SelectStmt)
c.Assert(ok, IsTrue)
Expand Down

0 comments on commit 8663db2

Please sign in to comment.