2024-03-27 10:33:25 +08:00
|
|
|
import { PostgreSQL } from 'src/parser/postgresql';
|
2024-01-16 11:14:03 +08:00
|
|
|
|
|
|
|
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
|
|
|
const unCompleteSQL = `CREATE TABLE`;
|
|
|
|
|
|
|
|
describe('Postgres SQL validate invalid sql', () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
const postgresql = new PostgreSQL();
|
2024-01-16 11:14:03 +08:00
|
|
|
|
|
|
|
test('validate random text', () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
expect(postgresql.validate(randomText).length).not.toBe(0);
|
2024-01-16 11:14:03 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
test('validate unComplete sql', () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
expect(postgresql.validate(unCompleteSQL).length).not.toBe(0);
|
2024-01-16 11:14:03 +08:00
|
|
|
});
|
|
|
|
});
|