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