From 0f6c7849f24eb0cd11c237603aad223e995b098f Mon Sep 17 00:00:00 2001 From: xiaowei Date: Tue, 5 Jan 2021 17:41:21 +0800 Subject: [PATCH] refactor(test): import from src index file --- test/parser/flinksql/lexer.test.ts | 5 +++-- test/parser/flinksql/listener.test.ts | 6 ++---- test/parser/flinksql/syntax.test.ts | 4 ++-- test/parser/flinksql/visitor.test.ts | 4 ++-- test/parser/generic/lexer.test.ts | 4 ++-- test/parser/generic/listener.test.ts | 4 ++-- test/parser/generic/syntax.test.ts | 4 ++-- test/parser/generic/visitor.test.ts | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/test/parser/flinksql/lexer.test.ts b/test/parser/flinksql/lexer.test.ts index 7b59601..2e484fb 100644 --- a/test/parser/flinksql/lexer.test.ts +++ b/test/parser/flinksql/lexer.test.ts @@ -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); diff --git a/test/parser/flinksql/listener.test.ts b/test/parser/flinksql/listener.test.ts index e346622..535f930 100644 --- a/test/parser/flinksql/listener.test.ts +++ b/test/parser/flinksql/listener.test.ts @@ -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); diff --git a/test/parser/flinksql/syntax.test.ts b/test/parser/flinksql/syntax.test.ts index 4a6fa25..bf2ac07 100644 --- a/test/parser/flinksql/syntax.test.ts +++ b/test/parser/flinksql/syntax.test.ts @@ -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', () => { diff --git a/test/parser/flinksql/visitor.test.ts b/test/parser/flinksql/visitor.test.ts index a3d5bc8..52fd9d8 100644 --- a/test/parser/flinksql/visitor.test.ts +++ b/test/parser/flinksql/visitor.test.ts @@ -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); diff --git a/test/parser/generic/lexer.test.ts b/test/parser/generic/lexer.test.ts index b3940f3..7b24d42 100644 --- a/test/parser/generic/lexer.test.ts +++ b/test/parser/generic/lexer.test.ts @@ -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); diff --git a/test/parser/generic/listener.test.ts b/test/parser/generic/listener.test.ts index 54a31ab..0774e0f 100644 --- a/test/parser/generic/listener.test.ts +++ b/test/parser/generic/listener.test.ts @@ -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); diff --git a/test/parser/generic/syntax.test.ts b/test/parser/generic/syntax.test.ts index 046ef1e..433ddca 100644 --- a/test/parser/generic/syntax.test.ts +++ b/test/parser/generic/syntax.test.ts @@ -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;'; diff --git a/test/parser/generic/visitor.test.ts b/test/parser/generic/visitor.test.ts index 9119688..3d470fc 100644 --- a/test/parser/generic/visitor.test.ts +++ b/test/parser/generic/visitor.test.ts @@ -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);