mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase
This commit is contained in:
+2
-1
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user