2023-10-13 11:16:36 +08:00
|
|
|
import PostgresSQL from '../../../src/parser/pgsql';
|
|
|
|
import { readSQL } from '../../helper';
|
2023-05-30 14:44:03 +08:00
|
|
|
|
|
|
|
const parser = new PostgresSQL();
|
|
|
|
|
|
|
|
const features = {
|
2023-10-13 11:16:36 +08:00
|
|
|
base: readSQL(__dirname, 'select.sql'),
|
2023-05-30 14:44:03 +08:00
|
|
|
};
|
|
|
|
|
2023-10-13 11:16:36 +08:00
|
|
|
describe('Postgre SQL Query Statement Tests', () => {
|
|
|
|
describe('Base Select', () => {
|
2023-05-30 14:44:03 +08:00
|
|
|
features.base.forEach((sql) => {
|
|
|
|
it(sql, () => {
|
|
|
|
expect(parser.validate(sql).length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|