2021-01-05 17:41:21 +08:00
|
|
|
import { GenericSQL } from '../../../src';
|
2020-09-11 17:39:10 +08:00
|
|
|
|
|
|
|
describe('Generic SQL Syntax Tests', () => {
|
2021-01-05 17:41:21 +08:00
|
|
|
const parser = new GenericSQL();
|
2020-09-11 17:39:10 +08:00
|
|
|
|
|
|
|
test('Select Statement', () => {
|
|
|
|
const sql = 'select id,name from user1;';
|
|
|
|
const result = parser.validate(sql);
|
|
|
|
|
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Select 1+1', () => {
|
|
|
|
const sql = 'SELECT 1+1;';
|
|
|
|
const result = parser.validate(sql);
|
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|