use of com.alibaba.druid.sql.dialect.mysql.parser.MySqlLexer in project druid by alibaba.
the class FirstCommentTest method test_first_commnet.
public void test_first_commnet() throws Exception {
String sql = "/*test sql*/select age from user where name = 'xx';";
Lexer lexer = new MySqlLexer(sql);
lexer.setKeepComments(true);
lexer.nextToken();
List<String> comments = lexer.readAndResetComments();
Assert.assertEquals("/*test sql*/", comments.get(0));
}
Aggregations