mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 03:06:00 +00:00
parse comments
This commit is contained in:
@@ -47,3 +47,15 @@ test('delimiter test', () => {
|
||||
const output = splitQuery(input, mysqlSplitterOptions);
|
||||
expect(output).toEqual(['SELECT 1', 'SELECT 2; SELECT 3;']);
|
||||
});
|
||||
|
||||
test('one line comment test', () => {
|
||||
const input = 'SELECT 1 -- comment1;comment2\n;SELECT 2';
|
||||
const output = splitQuery(input, mysqlSplitterOptions);
|
||||
expect(output).toEqual(['SELECT 1 -- comment1;comment2', 'SELECT 2']);
|
||||
});
|
||||
|
||||
test('multi line comment test', () => {
|
||||
const input = 'SELECT 1 /* comment1;comment2\ncomment3*/;SELECT 2';
|
||||
const output = splitQuery(input, mysqlSplitterOptions);
|
||||
expect(output).toEqual(['SELECT 1 /* comment1;comment2\ncomment3*/', 'SELECT 2']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user