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