diff --git a/packages/compiler/test/ml_parser/html_parser_spec.ts b/packages/compiler/test/ml_parser/html_parser_spec.ts index 45dcc1d957..a47d29ca3b 100644 --- a/packages/compiler/test/ml_parser/html_parser_spec.ts +++ b/packages/compiler/test/ml_parser/html_parser_spec.ts @@ -239,6 +239,23 @@ import {humanizeDom, humanizeDomSourceSpans, humanizeLineColumn, humanizeNodes} ]); expect(parsed.errors).toEqual([]); }); + + it('should treat prematurely terminated interpolation as text', () => { + const {errors, rootNodes} = + parser.parse('
x {{ expr }} y
', 'TestComp'); + expect(humanizeNodes(rootNodes, true)).toEqual([ + [ + html.Element, 'div', 0, '
x {{ expr }} y
', + '
', '
' + ], + [html.Element, 'span', 1, 'x {{ expr }} y', '', ''], + [html.Text, 'x {{ expr }', 2, ['x '], ['{{', ' expr }'], [''], 'x {{ expr }'], + [html.Comment, '', 2, '