bb0fad1dbe
* refactor: rename flinksql to flink * refactor: rename pgsql to postgresql * refactor: rename trinosql to trino * refactor: replace all default exports with named export * refactor: rename basicParser to basicSQL * refactor: rename basic-parser-types to types * refactor: replace arrow func with plain func
23 lines
692 B
TypeScript
23 lines
692 B
TypeScript
import { SparkSQL } from 'src/parser/spark';
|
|
import { readSQL } from 'test/helper';
|
|
|
|
const spark = new SparkSQL();
|
|
|
|
const features = {
|
|
dropDatabase: readSQL(__dirname, 'dropDatabase.sql'),
|
|
dropFunction: readSQL(__dirname, 'dropFunction.sql'),
|
|
dropTable: readSQL(__dirname, 'dropTable.sql'),
|
|
dropView: readSQL(__dirname, 'dropView.sql'),
|
|
dropMaterializedView: readSQL(__dirname, 'dropMaterializedView.sql'),
|
|
};
|
|
|
|
describe('SparkSQL Drop Syntax Tests', () => {
|
|
Object.keys(features).forEach((key) => {
|
|
features[key].forEach((sql) => {
|
|
it(sql, () => {
|
|
expect(spark.validate(sql).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
});
|