From 850b6087fdfed7fabf259d0bc1f7dd1d3e571592 Mon Sep 17 00:00:00 2001 From: xiaowei Date: Wed, 8 Sep 2021 20:33:30 +0800 Subject: [PATCH] test: split special sqls --- test/utils/index.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/utils/index.test.ts b/test/utils/index.test.ts index c50d9b4..0422bef 100644 --- a/test/utils/index.test.ts +++ b/test/utils/index.test.ts @@ -7,6 +7,7 @@ describe('utils', () => { const result = splitSql(sql); expect(result.length).toEqual(1); }); + test('split multiple sql', () => { const sql = `-- a ; select * from a; @@ -18,6 +19,14 @@ describe('utils', () => { const result = splitSql(sql); expect(result.length).toEqual(2); }); + + test('split special quotation sql', () => { + const sql = `select regexp_replace('a', 'bc', 'xfe'feefe', '233'); + select regexp_replace('abc', "fe", '233');`; + const result = splitSql(sql); + expect(result.length).toEqual(2); + }); + test('lexer', () => { const sql = `-- a ; select * from a;