Skip to content

Commit fdda573

Browse files
Added more tests
1 parent 2b899a8 commit fdda573

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/next-char.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,43 @@ describe(RAA.getFirstConsumedChar.name, function () {
132132
{ regexp: /(?<=a)[ab]/, expected: { char: toCharSet(/[ab]/), exact: false, empty: false } },
133133
{ regexp: /\b[ab]/, expected: { char: toCharSet(/[ab]/), exact: false, empty: false } },
134134

135+
{
136+
regexp: /\b/,
137+
expected: {
138+
char: toCharSet(/[]/),
139+
exact: true,
140+
empty: true,
141+
look: { char: toCharSet(/[^]/), exact: false, edge: true },
142+
},
143+
},
144+
{
145+
regexp: /\B/,
146+
expected: {
147+
char: toCharSet(/[]/),
148+
exact: true,
149+
empty: true,
150+
look: { char: toCharSet(/[^]/), exact: false, edge: true },
151+
},
152+
},
153+
{
154+
regexp: /^\b/,
155+
expected: {
156+
char: toCharSet(/[]/),
157+
exact: true,
158+
empty: true,
159+
look: { char: toCharSet(/[\w]/), exact: false, edge: false },
160+
},
161+
},
162+
{
163+
regexp: /^\B/,
164+
expected: {
165+
char: toCharSet(/[]/),
166+
exact: true,
167+
empty: true,
168+
look: { char: toCharSet(/[\W]/), exact: false, edge: true },
169+
},
170+
},
171+
135172
// make exact again
136173
{ regexp: /\b[ab]|[ab]/, expected: { char: toCharSet(/[ab]/), exact: true, empty: false } },
137174
// doesn't work here unfortunately

0 commit comments

Comments
 (0)