2023-12-19 19:22:27 +08:00
|
|
|
import { SparkSQL } from '../../../filters';
|
2023-10-12 17:08:21 +08:00
|
|
|
import { readSQL } from '../../../helper';
|
|
|
|
|
|
|
|
const parser = new SparkSQL();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 关键词有多个值
|
|
|
|
* KW_NOT: 'NOT' | '!'
|
|
|
|
* KW_RLIKE: 'RLIKE' | 'REGEXP';
|
|
|
|
*/
|
|
|
|
const features = {
|
|
|
|
kwMultipleValues: readSQL(__dirname, 'kwMultipleValues.sql'),
|
|
|
|
};
|
|
|
|
|
2023-10-18 10:53:43 +08:00
|
|
|
describe('SparkSQL Keyword Has Multiple Values Syntax Tests', () => {
|
2023-10-12 17:08:21 +08:00
|
|
|
Object.keys(features).forEach((key) => {
|
|
|
|
features[key].forEach((sql) => {
|
|
|
|
it(sql, () => {
|
|
|
|
expect(parser.validate(sql).length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|