add testcase

This commit is contained in:
shaojin.wensj
2015-07-11 23:09:39 +08:00
parent aecd9aeed7
commit a0ad1cda0c
4 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
/.settings
/.project
/.classpath
/.DS_Store
/1
/derby.log
@@ -11,4 +12,4 @@ out/
*.ipr
*.iws
*.iml
/bin
/bin
@@ -46,7 +46,7 @@ public interface SQLObject {
boolean hasBeforeComment();
boolean hasAfterComment()
boolean hasAfterComment();
void output(StringBuffer buf);
}
@@ -0,0 +1,17 @@
package com.alibaba.druid.bvt.sql.odps;
import org.junit.Assert;
import com.alibaba.druid.sql.SQLUtils;
import junit.framework.TestCase;
public class OdpsAsNumberFirstTest extends TestCase {
public void test_0() throws Exception {
String sql = "select id as 39dd"
+ "\n from t1";
Assert.assertEquals("SELECT id AS 39dd" //
+ "\nFROM t1", SQLUtils.formatOdps(sql));
}
}
@@ -37,6 +37,8 @@ import com.alibaba.druid.util.Utils;
public class OdpsSelectTest extends TestCase {
public void test_0() throws Exception {
exec_test("bvt/parser/odps-1.sql");
exec_test("bvt/parser/odps-2.sql");
exec_test("bvt/parser/odps-3.sql");
}