aboutsummaryrefslogtreecommitdiff
path: root/plugin/test/brackets.test.js
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-21 10:31:09 +0000
committer_ov4 <ov4@ov4.org>2026-10-21 10:31:09 +0000
commitaf6bb061ff447f860c514b60202c3192ceec952b (patch)
tree09cf21eb75b8d7f6b1771c38765341836a2b890c /plugin/test/brackets.test.js
parent9939ebe7f0ec25b042c9d83ed651cde0e2ea3a30 (diff)
fix(plugin): recognize literal escapes and C string suffixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'plugin/test/brackets.test.js')
-rw-r--r--plugin/test/brackets.test.js9
1 files changed, 6 insertions, 3 deletions
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]);
});