From 6feaf43d1d54c7edcc95aa875ab9d822f9151942 Mon Sep 17 00:00:00 2001 From: "Matthew D. Miller" Date: Wed, 10 Oct 2018 10:33:49 -0500 Subject: [PATCH] Added tests for quoted strings and regexes using alternative delimiters --- src/perl/perl.test.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/perl/perl.test.ts b/src/perl/perl.test.ts index 879c2b3c..913c1688 100644 --- a/src/perl/perl.test.ts +++ b/src/perl/perl.test.ts @@ -429,4 +429,39 @@ testTokenization('perl', [ ], }, ], + + // Quoted constructs + [ + { + line: "m!can't!", + tokens: [ + { startIndex: 0, type: 'regexp.delim.perl' }, + { startIndex: 2, type: 'regexp.perl' }, + { startIndex: 7, type: 'regexp.delim.perl' }, + ], + }, + ], + + [ + { + line: 'q XfooX', + tokens: [ + { startIndex: 0, type: 'string.delim.perl' }, + { startIndex: 3, type: 'string.perl' }, + { startIndex: 6, type: 'string.delim.perl' }, + ], + }, + ], + + [ + { + line: 'qq(test $foo)', + tokens: [ + { startIndex: 0, type: 'string.delim.perl' }, + { startIndex: 3, type: 'string.perl' }, + { startIndex: 8, type: 'variable.perl' }, + { startIndex: 12, type: 'string.delim.perl' }, + ], + }, + ], ]);