From af6bb061ff447f860c514b60202c3192ceec952b Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 10:31:09 +0000 Subject: fix(plugin): recognize literal escapes and C string suffixes Co-Authored-By: Claude Opus 5.5 --- plugin/test/brackets.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugin/test/brackets.test.js') diff --git a/plugin/test/brackets.test.js b/plugin/test/brackets.test.js index e144335..a62e657 100644 --- a/plugin/test/brackets.test.js +++ b/plugin/test/brackets.test.js @@ -24,8 +24,11 @@ test('comments and quotes are ignored with correct UTF-16 offsets after Unicode assert.deepEqual(unmatchedBrackets(unfinished), [unfinished.length - 1]); const unicode = 'OUTPUT "Hello๐Ÿ˜€"\r\nA['; assert.deepEqual(unmatchedBrackets(unicode), [unicode.length - 1]); - // Backslashes do not escape CIE quotes. - assert.deepEqual(unmatchedBrackets('"x\\"['), [4]); - const quoteChar = "OUTPUT ''' ["; + assert.deepEqual(unmatchedBrackets(String.raw`OUTPUT "x\"[(//"`), []); + const backslash = String.raw`OUTPUT "x\\" [`; + assert.deepEqual(unmatchedBrackets(backslash), [backslash.length - 1]); + const quoteChar = String.raw`OUTPUT '\'' [`; assert.deepEqual(unmatchedBrackets(quoteChar), [quoteChar.length - 1]); + const escaped = 'OUTPUT "๐Ÿ˜€\\"["\r\nA['; + assert.deepEqual(unmatchedBrackets(escaped), [escaped.length - 1]); }); -- cgit v1.3.1-4-g156e