@@ -265,6 +265,14 @@ describe('N3Lexer', function () {
265
265
{ type : 'literal' , value : '"string"' , line : 1 } ,
266
266
{ type : 'eof' , line : 1 } ) ) ;
267
267
268
+ it ( 'should not tokenize a quoted string literal with a newline' ,
269
+ shouldNotTokenize ( '"abc\ndef" ' ,
270
+ 'Unexpected ""abc" on line 1.' ) ) ;
271
+
272
+ it ( 'should not tokenize a quoted string literal with a carriage return' ,
273
+ shouldNotTokenize ( '"abc\rdef" ' ,
274
+ 'Unexpected ""abc" on line 1.' ) ) ;
275
+
268
276
it ( 'should tokenize a triple quoted string literal' ,
269
277
shouldTokenize ( '"""string"""' ,
270
278
{ type : 'literal' , value : '"string"' , line : 1 } ,
@@ -325,6 +333,14 @@ describe('N3Lexer', function () {
325
333
{ type : 'literal' , value : '"string"' , line : 1 } ,
326
334
{ type : 'eof' , line : 1 } ) ) ;
327
335
336
+ it ( 'should not tokenize a single-quoted string literal with a newline' ,
337
+ shouldNotTokenize ( "'abc\ndef' " ,
338
+ 'Unexpected "\'abc" on line 1.' ) ) ;
339
+
340
+ it ( 'should not tokenize a single-quoted string literal with a carriage return' ,
341
+ shouldNotTokenize ( "'abc\rdef' " ,
342
+ 'Unexpected "\'abc" on line 1.' ) ) ;
343
+
328
344
it ( 'should tokenize a triple single-quoted string literal with quotes newlines inside' ,
329
345
shouldTokenize ( "'''st'r\ni''ng'''" ,
330
346
{ type : 'literal' , value : '"st\'r\ni\'\'ng"' , line : 1 } ,
0 commit comments