From 6c86e8d80a2ab64d3b2a4a79514dc3137ee1e683 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 30 Jun 2016 11:00:12 -0700 Subject: [PATCH] test(HtmlLexer): Add test for "{" and "{{" escaping --- .../@angular/compiler/test/html_lexer_spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/@angular/compiler/test/html_lexer_spec.ts b/modules/@angular/compiler/test/html_lexer_spec.ts index c6da634504..d8429dcfb6 100644 --- a/modules/@angular/compiler/test/html_lexer_spec.ts +++ b/modules/@angular/compiler/test/html_lexer_spec.ts @@ -507,6 +507,22 @@ export function main() { [HtmlTokenType.EOF], ]); }); + + it('should be able to escape {', () => { + expect(tokenizeAndHumanizeParts('{{ "{" }}')).toEqual([ + [HtmlTokenType.TEXT, '{{ "{" }}'], + [HtmlTokenType.EOF], + ]); + }); + + it('should be able to escape {{', () => { + expect(tokenizeAndHumanizeParts('{{ "{{" }}')).toEqual([ + [HtmlTokenType.TEXT, '{{ "{{" }}'], + [HtmlTokenType.EOF], + ]); + }); + + }); describe('raw text', () => {