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