diff options
author | Sascha <GlancingMind@outlook.com> | 2021-05-03 15:23:42 +0200 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-05-20 17:07:46 +0200 |
commit | 77d36247b3b761e21ef38a764d315cd4d22e7668 (patch) | |
tree | 562cdadec7767c3111a048834a42be188e49b91a /webui/src/__tests__ | |
parent | 817732948d3b7cf0e7a4c2987cd0f7dd5729288b (diff) | |
download | git-bug-77d36247b3b761e21ef38a764d315cd4d22e7668.tar.gz |
Update escape quote test
Diffstat (limited to 'webui/src/__tests__')
-rw-r--r-- | webui/src/__tests__/query.ts | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/webui/src/__tests__/query.ts b/webui/src/__tests__/query.ts index 7abcecd2..69e2f766 100644 --- a/webui/src/__tests__/query.ts +++ b/webui/src/__tests__/query.ts @@ -24,7 +24,6 @@ it('parses a query with multiple filters', () => { in: [''], freetext: [''], }); - }); it('parses a quoted query', () => { @@ -55,9 +54,23 @@ it('parses a quoted query', () => { expect(parse(`label:"with:quoated:colon"`)).toEqual({ label: [`"with:quoated:colon"`], }); +}); + +it('should not escape nested quotes', () => { + expect(parse(`foo:'do not escape this ->'<- quote'`)).toEqual({ + foo: [`'do not escape this ->'<- quote'`], + }); + + expect(parse(`foo:'do not escape this ->"<- quote'`)).toEqual({ + foo: [`'do not escape this ->"<- quote'`], + }); + + expect(parse(`foo:"do not escape this ->"<- quote"`)).toEqual({ + foo: [`"do not escape this ->"<- quote"`], + }); - expect(parse(`foo:'escaped\\' quotes'`)).toEqual({ - foo: [`'escaped\\' quotes'`], + expect(parse(`foo:"do not escape this ->'<- quote"`)).toEqual({ + foo: [`"do not escape this ->'<- quote"`], }); }); @@ -76,9 +89,11 @@ it('parses a complex query', () => { }); it('parses a key:value:value query', () => { - expect(parse(`meta:github:"https://github.com/MichaelMure/git-bug"`)).toEqual({ - meta: [`github:"https://github.com/MichaelMure/git-bug"`], - }); + expect(parse(`meta:github:"https://github.com/MichaelMure/git-bug"`)).toEqual( + { + meta: [`github:"https://github.com/MichaelMure/git-bug"`], + } + ); }); it('quotes values', () => { |