refactor(test): import from src index file
This commit is contained in:
parent
ca44962acc
commit
0f6c7849f2
@ -1,6 +1,7 @@
|
||||
import SQLParser from '../../../src/parser/flinksql';
|
||||
import { FlinkSQL } from '../../../src';
|
||||
|
||||
describe('FlinkSQL Lexer tests', () => {
|
||||
const parser = new SQLParser();
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
const sql = 'SELECT * FROM table1';
|
||||
const tokens = parser.getAllTokens(sql);
|
||||
|
@ -1,11 +1,9 @@
|
||||
import
|
||||
SQLParser, { FlinkSqlParserListener }
|
||||
from '../../../src/parser/flinksql';
|
||||
import { FlinkSQL, FlinkSqlParserListener } from '../../../src';
|
||||
|
||||
describe('Flink SQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
const sql = `select id,name,sex from ${expectTableName};`;
|
||||
const parser = new SQLParser();
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
const parserTree = parser.parse(sql);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import SQLParser from '../../../src/parser/flinksql';
|
||||
import { FlinkSQL } from '../../../src';
|
||||
|
||||
describe('FlinkSQL Syntax Tests', () => {
|
||||
const parser = new SQLParser();
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
// Create statements
|
||||
test('Test simple CreateTable Statement', () => {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import SQLParser, { FlinkSqlParserVisitor } from '../../../src/parser/flinksql';
|
||||
import { FlinkSQL, FlinkSqlParserVisitor } from '../../../src';
|
||||
|
||||
describe('Flink SQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
const sql = `select id,name,sex from ${expectTableName};`;
|
||||
const parser = new SQLParser();
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
const parserTree = parser.parse(sql, (error) => {
|
||||
console.log('Parse error:', error);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import SQLParser from '../../../src/parser/generic';
|
||||
import { GenericSQL } from '../../../src/';
|
||||
|
||||
describe('GenericSQL Lexer tests', () => {
|
||||
const mysqlParser = new SQLParser();
|
||||
const mysqlParser = new GenericSQL();
|
||||
|
||||
const sql = 'select id,name,sex from user1;';
|
||||
const tokens = mysqlParser.getAllTokens(sql);
|
||||
|
@ -1,9 +1,9 @@
|
||||
import SQLParser, { SqlParserListener } from '../../../src/parser/generic';
|
||||
import { GenericSQL, SqlParserListener } from '../../../src';
|
||||
|
||||
describe('Generic SQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
const sql = `select id,name,sex from ${expectTableName};`;
|
||||
const parser = new SQLParser();
|
||||
const parser = new GenericSQL();
|
||||
|
||||
const parserTree = parser.parse(sql);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import SQLParser from '../../../src/parser/generic';
|
||||
import { GenericSQL } from '../../../src';
|
||||
|
||||
describe('Generic SQL Syntax Tests', () => {
|
||||
const parser = new SQLParser();
|
||||
const parser = new GenericSQL();
|
||||
|
||||
test('Select Statement', () => {
|
||||
const sql = 'select id,name from user1;';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import SQLParser, { SqlParserVisitor } from '../../../src/parser/generic';
|
||||
import { GenericSQL, SqlParserVisitor } from '../../../src';
|
||||
|
||||
describe('Generic SQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
const sql = `select id,name,sex from ${expectTableName};`;
|
||||
const parser = new SQLParser();
|
||||
const parser = new GenericSQL();
|
||||
|
||||
const parserTree = parser.parse(sql, (error) => {
|
||||
console.log('Parse error:', error);
|
||||
|
Loading…
Reference in New Issue
Block a user