Skip to content

Commit dce8d47

Browse files
committed
Fix SDBL brace test regex (Punct(Comma) breaks [^)]*)
1 parent 04899dd commit dce8d47

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/sdbl-overlay.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ describe("SDBL parser standalone", () => {
3434
const repr = sdblLanguage.parse(
3535
"ВЫБРАТЬ {Поле1, Поле2} ИЗ Справочник.Контрагенты"
3636
).toString()
37-
assert.match(repr, /BraceGroup\(LBrace[^)]*RBrace\)/)
37+
// Inner Punct(Comma) contains a ')' so we can't use [^)]*; this matcher
38+
// just checks the BraceGroup opens with LBrace and contains RBrace.
39+
assert.match(repr, /BraceGroup\(LBrace,/)
40+
assert.match(repr, /,RBrace\)/)
3841
// No error markers anywhere in the tree.
3942
assert.doesNotMatch(repr, //)
4043
})

0 commit comments

Comments
 (0)