Skip to content

Commit b437de9

Browse files
committed
more tests
1 parent 386788f commit b437de9

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/language/__tests__/lexer-test.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,50 @@ describe('Lexer', () => {
288288
end: 65,
289289
value: 'string with unicode code point outside BMP escaped 😀',
290290
});
291+
292+
expect(
293+
lexOne(
294+
'"string with unicode code point outside BMP escaped \\uD800\\uDC00"',
295+
),
296+
).to.contain({
297+
kind: TokenKind.STRING,
298+
start: 0,
299+
end: 65,
300+
value: 'string with unicode code point outside BMP escaped \uD800\uDC00',
301+
});
302+
303+
expect(
304+
lexOne(
305+
'"string with unicode code point outside BMP escaped \\uDBFF\\uDC00"',
306+
),
307+
).to.contain({
308+
kind: TokenKind.STRING,
309+
start: 0,
310+
end: 65,
311+
value: 'string with unicode code point outside BMP escaped \uDBFF\uDC00',
312+
});
313+
314+
expect(
315+
lexOne(
316+
'"string with unicode code point outside BMP escaped \\uDBFF\\uDFFF"',
317+
),
318+
).to.contain({
319+
kind: TokenKind.STRING,
320+
start: 0,
321+
end: 65,
322+
value: 'string with unicode code point outside BMP escaped \uDBFF\uDFFF',
323+
});
324+
325+
expect(
326+
lexOne(
327+
'"string with unicode code point outside BMP escaped \\uD800\\uDFFF"',
328+
),
329+
).to.contain({
330+
kind: TokenKind.STRING,
331+
start: 0,
332+
end: 65,
333+
value: 'string with unicode code point outside BMP escaped \uD800\uDFFF',
334+
});
291335
});
292336

293337
it('lex reports useful string errors', () => {

0 commit comments

Comments
 (0)