2023-05-04 10:13:05 +08:00
|
|
|
import GenericSQL from '../../../src/parser/generic';
|
2020-09-11 17:39:10 +08:00
|
|
|
|
|
|
|
describe('GenericSQL Lexer tests', () => {
|
2021-01-05 17:41:21 +08:00
|
|
|
const mysqlParser = new GenericSQL();
|
2020-09-11 17:39:10 +08:00
|
|
|
|
|
|
|
const sql = 'select id,name,sex from user1;';
|
|
|
|
const tokens = mysqlParser.getAllTokens(sql);
|
|
|
|
|
|
|
|
test('token counts', () => {
|
2023-05-30 14:44:03 +08:00
|
|
|
expect(tokens.length).toBe(12);
|
2020-09-11 17:39:10 +08:00
|
|
|
});
|
|
|
|
});
|