From 0bea0e28f4138e52c5d7c773ef6231cd9037b79b Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 11 Nov 2026 23:02:17 +0800 Subject: [PATCH 01/13] chore(conformance): bump angular submodule to v22.3.0-next.4 Angular 22.2 added @boundary/@error blocks and 22.3.0-next added ++/-- in event listeners. Move the reference submodule so their specs are extracted, and regenerate the fixtures and snapshot. Co-Authored-By: Claude Opus 5.5 --- crates/angular_conformance/README.md | 2 +- .../expression_parser_lexer_spec.json | 458 ++ .../expression_parser_parser_spec.json | 1196 ++- .../expression_parser_serializer_spec.json | 48 + .../ml_parser_ast_serializer_spec.json | 20 +- .../fixtures/ml_parser_html_parser_spec.json | 1434 +++- .../ml_parser_html_whitespaces_spec.json | 386 +- .../fixtures/ml_parser_lexer_spec.json | 6408 +++++++++++++---- .../output_abstract_emitter_spec.json | 127 + .../render3_r3_ast_absolute_span_spec.json | 366 +- .../fixtures/render3_r3_ast_spans_spec.json | 995 ++- .../render3_r3_template_transform_spec.json | 3325 +++++++-- .../fixtures/render3_style_parser_spec.json | 59 +- .../fixtures/render3_view_binding_spec.json | 25 + .../fixtures/shadow_css_at_rules_spec.json | 5 + .../fixtures/shadow_css_keyframes_spec.json | 5 + .../fixtures/shadow_css_nesting_spec.json | 165 + .../fixtures/shadow_css_shadow_css_spec.json | 191 + .../fixtures/util_spec.json | 42 + .../snapshots/angular.snap.md | 1888 ++++- crates/oxc_angular_compiler/angular | 2 +- 21 files changed, 14681 insertions(+), 2466 deletions(-) create mode 100644 crates/angular_conformance/fixtures/shadow_css_nesting_spec.json diff --git a/crates/angular_conformance/README.md b/crates/angular_conformance/README.md index 8302d8409d..c533d27018 100644 --- a/crates/angular_conformance/README.md +++ b/crates/angular_conformance/README.md @@ -4,7 +4,7 @@ A conformance testing framework that validates the oxc Angular compiler implemen ## Overview -This crate extracts test cases from Angular's TypeScript spec files and runs them against the Rust implementation to ensure compatibility. It currently maintains a **100% pass rate** across **1,264** extracted test assertions against Angular **v22.0.0-rc.2**. +This crate extracts test cases from Angular's TypeScript spec files and runs them against the Rust implementation to ensure compatibility. It currently maintains a **100% pass rate** across **1,264** extracted test assertions against Angular **v22.3.0-next.4**. ## Architecture diff --git a/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json b/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json index 800f28615c..5681335cde 100644 --- a/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json @@ -4123,6 +4123,464 @@ } ] }, + { + "name": "should tokenize increment/decrement operators", + "path": "lexer/token/should tokenize increment/decrement operators", + "assertions": [ + { + "type": "ExpressionLexerTest", + "input": "++", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "++" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "--", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "--" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a++", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "++" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a--", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "--" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "++a", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "++" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "--a", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "--" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "--a", + "expected_token_count": null, + "token_assertions": [] + } + ] + }, + { + "name": "should tokenize increment/decrement operators used together with plus/minus", + "path": "lexer/token/should tokenize increment/decrement operators used together with plus/minus", + "assertions": [ + { + "type": "ExpressionLexerTest", + "input": "+++a", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 2, + "end": 3, + "value": "+" + }, + { + "assertion_type": "Identifier", + "token_index": 2, + "start": 3, + "end": 4, + "value": "a" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "---a", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "--" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 2, + "end": 3, + "value": "-" + }, + { + "assertion_type": "Identifier", + "token_index": 2, + "start": 3, + "end": 4, + "value": "a" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "-- foo++", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 2, + "value": "--" + }, + { + "assertion_type": "Identifier", + "token_index": 1, + "start": 3, + "end": 6, + "value": "foo" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 6, + "end": 8, + "value": "++" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "- - foo++", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Operator", + "token_index": 0, + "start": 0, + "end": 1, + "value": "-" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 2, + "end": 3, + "value": "-" + }, + { + "assertion_type": "Identifier", + "token_index": 2, + "start": 4, + "end": 7, + "value": "foo" + }, + { + "assertion_type": "Operator", + "token_index": 3, + "start": 7, + "end": 9, + "value": "++" + } + ] + } + ] + }, + { + "name": "should tokenize increment/decrement operators followed by other operators in an expression", + "path": "lexer/token/should tokenize increment/decrement operators followed by other operators in an expression", + "assertions": [ + { + "type": "ExpressionLexerTest", + "input": "a+++b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 3, + "end": 4, + "value": "+" + }, + { + "assertion_type": "Identifier", + "token_index": 3, + "start": 4, + "end": 5, + "value": "b" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a+++++b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 3, + "end": 5, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 3, + "start": 5, + "end": 6, + "value": "+" + }, + { + "assertion_type": "Identifier", + "token_index": 4, + "start": 6, + "end": 7, + "value": "b" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a-----b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "--" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 3, + "end": 5, + "value": "--" + }, + { + "assertion_type": "Operator", + "token_index": 3, + "start": 5, + "end": 6, + "value": "-" + }, + { + "assertion_type": "Identifier", + "token_index": 4, + "start": 6, + "end": 7, + "value": "b" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a+++ +b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 3, + "end": 4, + "value": "+" + }, + { + "assertion_type": "Operator", + "token_index": 3, + "start": 5, + "end": 6, + "value": "+" + }, + { + "assertion_type": "Identifier", + "token_index": 4, + "start": 6, + "end": 7, + "value": "b" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a+--b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 2, + "value": "+" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 2, + "end": 4, + "value": "--" + }, + { + "assertion_type": "Identifier", + "token_index": 3, + "start": 4, + "end": 5, + "value": "b" + } + ] + }, + { + "type": "ExpressionLexerTest", + "input": "a+++=b", + "expected_token_count": null, + "token_assertions": [ + { + "assertion_type": "Identifier", + "token_index": 0, + "start": 0, + "end": 1, + "value": "a" + }, + { + "assertion_type": "Operator", + "token_index": 1, + "start": 1, + "end": 3, + "value": "++" + }, + { + "assertion_type": "Operator", + "token_index": 2, + "start": 3, + "end": 5, + "value": "+=" + }, + { + "assertion_type": "Identifier", + "token_index": 3, + "start": 5, + "end": 6, + "value": "b" + } + ] + } + ] + }, { "name": "should tokenize a spread operator", "path": "lexer/token/should tokenize a spread operator", diff --git a/crates/angular_conformance/fixtures/expression_parser_parser_spec.json b/crates/angular_conformance/fixtures/expression_parser_parser_spec.json index 3045d33f69..53726518c6 100644 --- a/crates/angular_conformance/fixtures/expression_parser_parser_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_parser_spec.json @@ -839,6 +839,282 @@ "expected": null } ] + }, + { + "name": "should report invalid increment/decrement expressions", + "path": "parser/parseAction/assignment/should report invalid increment/decrement expressions", + "assertions": [ + { + "type": "ExpectActionError", + "input": "-- foo++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++ foo--", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "a?.a++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++a?.a", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "a?.[0]++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++a?.[0]", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "5++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++5", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "foo()++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++foo()", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "---foo", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "+++foo", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "(foo++)++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++(foo++)", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++foo++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "--foo--", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++foo--", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "--foo++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++ ++foo", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "-- --foo", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++foo+++bar", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "(-foo)++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "(foo + bar)++", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "++(foo + bar)", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "\"foo\"++", + "error_contains": "cannot be used in the assignment" + } + ] + }, + { + "name": "should report unexpected token for chained postfix operators", + "path": "parser/parseAction/assignment/should report unexpected token for chained postfix operators", + "assertions": [ + { + "type": "ExpectActionError", + "input": "foo++ ++", + "error_contains": "Unexpected token '++'" + }, + { + "type": "ExpectActionError", + "input": "foo-- --", + "error_contains": "Unexpected token '--'" + }, + { + "type": "ExpectActionError", + "input": "foo+++++bar", + "error_contains": "Unexpected token '++'" + }, + { + "type": "ExpectActionError", + "input": "foo-----bar", + "error_contains": "Unexpected token '--'" + } + ] + }, + { + "name": "should report a dangling + or - left over after an update operator", + "path": "parser/parseAction/assignment/should report a dangling + or - left over after an update operator", + "assertions": [ + { + "type": "ExpectActionError", + "input": "a+++", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "a---", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "a++ +", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "a++-", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "++a+", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "a+++b+", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "foo.bar+++", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "foo[0]+++", + "error_contains": "Unexpected end of expression" + } + ] + }, + { + "name": "should report a increment/decrement expression with no target", + "path": "parser/parseAction/assignment/should report a increment/decrement expression with no target", + "assertions": [ + { + "type": "ExpectActionError", + "input": "++", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "--", + "error_contains": "Unexpected end of expression" + }, + { + "type": "ExpectActionError", + "input": "+++", + "error_contains": "Unexpected end of expression" + } + ] + }, + { + "name": "should not allow member access or calls after a postfix update", + "path": "parser/parseAction/assignment/should not allow member access or calls after a postfix update", + "assertions": [ + { + "type": "ExpectActionError", + "input": "foo++.bar", + "error_contains": "Unexpected token '.'" + }, + { + "type": "ExpectActionError", + "input": "foo++[0]", + "error_contains": "Unexpected token '['" + }, + { + "type": "ExpectActionError", + "input": "foo++()", + "error_contains": "Unexpected token '('" + }, + { + "type": "ExpectActionError", + "input": "foo--.bar", + "error_contains": "Unexpected token '.'" + }, + { + "type": "ExpectActionError", + "input": "foo-- bar", + "error_contains": "Unexpected token 'bar'" + } + ] + }, + { + "name": "should not allow assigning to an update expression", + "path": "parser/parseAction/assignment/should not allow assigning to an update expression", + "assertions": [ + { + "type": "ExpectActionError", + "input": "foo++ = 1", + "error_contains": "Unexpected token '='" + }, + { + "type": "ExpectActionError", + "input": "++foo = 1", + "error_contains": "cannot be used in the assignment" + }, + { + "type": "ExpectActionError", + "input": "foo+++=bar", + "error_contains": "Unexpected token '+='" + } + ] } ] }, @@ -964,6 +1240,11 @@ "name": "should report error if interpolation is empty", "path": "parser/parseAction/template literals/should report error if interpolation is empty", "assertions": [ + { + "type": "CheckBinding", + "input": "`hello ${}`", + "expected": null + }, { "type": "ExpectBindingError", "input": "`hello ${}`", @@ -971,6 +1252,99 @@ } ] }, + { + "name": "should not report errors for valid interpolations", + "path": "parser/parseAction/template literals/should not report errors for valid interpolations", + "assertions": [] + }, + { + "name": "should report an error if an interpolation has unexpected tokens after the expression", + "path": "parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression", + "assertions": [ + { + "type": "ExpectBindingError", + "input": "`hello ${a b} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a & b} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a, b} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${`nested ${a b}`} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "{\"a\": `hello ${b c}`}", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "tag`hello ${a b} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a | pipe b} world`", + "error_contains": "Missing expected }" + }, + { + "type": "ExpectActionError", + "input": "`hello ${a; b} world`", + "error_contains": "Missing expected }" + } + ] + }, + { + "name": "should report an error if an interpolation is not closed", + "path": "parser/parseAction/template literals/should report an error if an interpolation is not closed", + "assertions": [ + { + "type": "ExpectBindingError", + "input": "`hello ${a", + "error_contains": "Missing expected } at the end of the expression" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a ", + "error_contains": "Missing expected } at the end of the expression" + } + ] + }, + { + "name": "should report an error if a template literal with an interpolation is not closed", + "path": "parser/parseAction/template literals/should report an error if a template literal with an interpolation is not closed", + "assertions": [ + { + "type": "ExpectBindingError", + "input": "`hello ${a}", + "error_contains": "Unterminated template literal" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a} world", + "error_contains": "Unterminated template literal" + }, + { + "type": "ExpectBindingError", + "input": "`hello ${a} and ${b} world", + "error_contains": "Unterminated template literal" + } + ] + }, + { + "name": "should retain all the elements and expressions of a malformed template literal", + "path": "parser/parseAction/template literals/should retain all the elements and expressions of a malformed template literal", + "assertions": [] + }, { "name": "should parse tagged template literals with no interpolations", "path": "parser/parseAction/template literals/should parse tagged template literals with no interpolations", @@ -1138,6 +1512,22 @@ } ] }, + { + "name": "should parse a regular expression literal that ends with an escaped slash", + "path": "parser/parseAction/regular expression literals/should parse a regular expression literal that ends with an escaped slash", + "assertions": [ + { + "type": "CheckBinding", + "input": "/^https?:\\/\\//", + "expected": null + }, + { + "type": "CheckBinding", + "input": "url.replace(/^\\//, \"\") //comment", + "expected": "url.replace(/^\\//, \"\")" + } + ] + }, { "name": "should report invalid regular expression flag", "path": "parser/parseAction/regular expression literals/should report invalid regular expression flag", @@ -1245,421 +1635,782 @@ "assertions": [ { "type": "CheckAction", - "input": "!true", + "input": "!true", + "expected": null + }, + { + "type": "CheckAction", + "input": "!!true", + "expected": null + }, + { + "type": "CheckAction", + "input": "!!!true", + "expected": null + } + ] + }, + { + "name": "should parse postfix ! expression", + "path": "parser/parseAction/should parse postfix ! expression", + "assertions": [ + { + "type": "CheckAction", + "input": "true!", + "expected": null + }, + { + "type": "CheckAction", + "input": "a!.b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a!!!!.b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a!()", + "expected": null + }, + { + "type": "CheckAction", + "input": "a.b!()", + "expected": null + } + ] + }, + { + "name": "should parse exponentiation expressions", + "path": "parser/parseAction/should parse exponentiation expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "1*2**3", + "expected": "1 * 2 ** 3" + } + ] + }, + { + "name": "should allow ++ and -- on the left-hand side of **", + "path": "parser/parseAction/should allow ++ and -- on the left-hand side of **", + "assertions": [ + { + "type": "CheckAction", + "input": "a++ ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "++a ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "a-- ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "--a ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "a.b++ ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0]++ ** 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 ** a++", + "expected": null + }, + { + "type": "CheckAction", + "input": "a ** b++ ** c", + "expected": null + } + ] + }, + { + "name": "should not allow other unary operators on the left-hand side of **", + "path": "parser/parseAction/should not allow other unary operators on the left-hand side of **", + "assertions": [] + }, + { + "name": "should parse multiplicative expressions", + "path": "parser/parseAction/should parse multiplicative expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "3*4/2%5", + "expected": "3 * 4 / 2 % 5" + } + ] + }, + { + "name": "should parse additive expressions", + "path": "parser/parseAction/should parse additive expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "3 + 6 - 2", + "expected": null + } + ] + }, + { + "name": "should parse relational expressions", + "path": "parser/parseAction/should parse relational expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "2 < 3", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 > 3", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 <= 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 >= 2", + "expected": null + }, + { + "type": "CheckAction", + "input": "\"key\" in obj", + "expected": null + }, + { + "type": "CheckAction", + "input": "foo instanceof Foo", + "expected": null + } + ] + }, + { + "name": "should parse equality expressions", + "path": "parser/parseAction/should parse equality expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "2 == 3", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 != 3", + "expected": null + } + ] + }, + { + "name": "should parse strict equality expressions", + "path": "parser/parseAction/should parse strict equality expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "2 === 3", + "expected": null + }, + { + "type": "CheckAction", + "input": "2 !== 3", + "expected": null + } + ] + }, + { + "name": "should parse expressions", + "path": "parser/parseAction/should parse expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "true && true", + "expected": null + }, + { + "type": "CheckAction", + "input": "true || false", + "expected": null + }, + { + "type": "CheckAction", + "input": "null ?? 0", + "expected": null + }, + { + "type": "CheckAction", + "input": "null ?? undefined ?? 0", + "expected": null + } + ] + }, + { + "name": "should parse typeof expression", + "path": "parser/parseAction/should parse typeof expression", + "assertions": [ + { + "type": "CheckAction", + "input": "typeof {} === \"object\"", + "expected": null + }, + { + "type": "CheckAction", + "input": "(!(typeof {} === \"number\"))", + "expected": null + } + ] + }, + { + "name": "should parse void expression", + "path": "parser/parseAction/should parse void expression", + "assertions": [ + { + "type": "CheckAction", + "input": "void 0", + "expected": null + }, + { + "type": "CheckAction", + "input": "(!(void 0))", + "expected": null + } + ] + }, + { + "name": "should parse grouped expressions", + "path": "parser/parseAction/should parse grouped expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "(1 + 2) * 3", + "expected": null + } + ] + }, + { + "name": "should parse in expressions", + "path": "parser/parseAction/should parse in expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "'key' in obj", + "expected": "\"key\" in obj" + }, + { + "type": "CheckAction", + "input": "('key' in obj) && true", + "expected": "(\"key\" in obj) && true" + }, + { + "type": "CheckAction", + "input": "'in' in {in: foo}", + "expected": "\"in\" in {in: foo}" + } + ] + }, + { + "name": "should throw on invalid in expressions", + "path": "parser/parseAction/should throw on invalid in expressions", + "assertions": [ + { + "type": "ExpectActionError", + "input": "in", + "error_contains": "Unexpected token in" + }, + { + "type": "ExpectActionError", + "input": "in foo", + "error_contains": "Unexpected token in" + }, + { + "type": "ExpectActionError", + "input": "'foo' in", + "error_contains": "Unexpected end of expression: 'foo' in at the end of the expression ['foo' in]" + } + ] + }, + { + "name": "should ignore comments in expressions", + "path": "parser/parseAction/should ignore comments in expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "a //comment", + "expected": "a" + } + ] + }, + { + "name": "should parse instanceof expressions", + "path": "parser/parseAction/should parse instanceof expressions", + "assertions": [ + { + "type": "CheckAction", + "input": "obj instanceof MyClass", + "expected": "obj instanceof MyClass" + }, + { + "type": "CheckAction", + "input": "(obj instanceof MyClass) || false", + "expected": "(obj instanceof MyClass) || false" + } + ] + }, + { + "name": "should retain // in string literals", + "path": "parser/parseAction/should retain // in string literals", + "assertions": [ + { + "type": "CheckAction", + "input": "\"http://www.google.com\"", + "expected": "\"http://www.google.com\"" + } + ] + }, + { + "name": "should parse an empty string", + "path": "parser/parseAction/should parse an empty string", + "assertions": [ + { + "type": "CheckAction", + "input": "", + "expected": null + } + ] + }, + { + "name": "should parse assignment operators with property reads", + "path": "parser/parseAction/should parse assignment operators with property reads", + "assertions": [ + { + "type": "CheckAction", + "input": "a = b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a += b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a -= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a *= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a /= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a %= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a **= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a &&= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a ||= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a ??= b", + "expected": null + } + ] + }, + { + "name": "should parse assignment operators with keyed reads", + "path": "parser/parseAction/should parse assignment operators with keyed reads", + "assertions": [ + { + "type": "CheckAction", + "input": "a[0] = b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] += b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] -= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] *= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] /= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] %= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] **= b", + "expected": null + }, + { + "type": "CheckAction", + "input": "a[0] &&= b", "expected": null }, { "type": "CheckAction", - "input": "!!true", + "input": "a[0] ||= b", "expected": null }, { "type": "CheckAction", - "input": "!!!true", + "input": "a[0] ??= b", "expected": null } ] }, { - "name": "should parse postfix ! expression", - "path": "parser/parseAction/should parse postfix ! expression", + "name": "should parse prefix ++ and --", + "path": "parser/parseAction/should parse prefix ++ and --", "assertions": [ { "type": "CheckAction", - "input": "true!", + "input": "++a", "expected": null }, { "type": "CheckAction", - "input": "a!.b", + "input": "--a", "expected": null }, { "type": "CheckAction", - "input": "a!!!!.b", + "input": "++a.b", "expected": null }, { "type": "CheckAction", - "input": "a!()", + "input": "--a.b", "expected": null }, { "type": "CheckAction", - "input": "a.b!()", + "input": "++a[0]", "expected": null - } - ] - }, - { - "name": "should parse exponentiation expressions", - "path": "parser/parseAction/should parse exponentiation expressions", - "assertions": [ - { - "type": "CheckAction", - "input": "1*2**3", - "expected": "1 * 2 ** 3" - } - ] - }, - { - "name": "should parse multiplicative expressions", - "path": "parser/parseAction/should parse multiplicative expressions", - "assertions": [ - { - "type": "CheckAction", - "input": "3*4/2%5", - "expected": "3 * 4 / 2 % 5" - } - ] - }, - { - "name": "should parse additive expressions", - "path": "parser/parseAction/should parse additive expressions", - "assertions": [ + }, { "type": "CheckAction", - "input": "3 + 6 - 2", + "input": "--a[0]", "expected": null - } - ] - }, - { - "name": "should parse relational expressions", - "path": "parser/parseAction/should parse relational expressions", - "assertions": [ + }, { "type": "CheckAction", - "input": "2 < 3", - "expected": null + "input": "++this.a", + "expected": "++a" }, { "type": "CheckAction", - "input": "2 > 3", - "expected": null + "input": "--this.a", + "expected": "--a" }, { "type": "CheckAction", - "input": "2 <= 2", + "input": "++a!", "expected": null }, { "type": "CheckAction", - "input": "2 >= 2", + "input": "--a!", "expected": null }, { "type": "CheckAction", - "input": "\"key\" in obj", + "input": "++(a)", "expected": null }, { "type": "CheckAction", - "input": "foo instanceof Foo", + "input": "--(a)", "expected": null } ] }, { - "name": "should parse equality expressions", - "path": "parser/parseAction/should parse equality expressions", + "name": "should parse postfix ++ and --", + "path": "parser/parseAction/should parse postfix ++ and --", "assertions": [ { "type": "CheckAction", - "input": "2 == 3", + "input": "a++", "expected": null }, { "type": "CheckAction", - "input": "2 != 3", + "input": "a--", "expected": null - } - ] - }, - { - "name": "should parse strict equality expressions", - "path": "parser/parseAction/should parse strict equality expressions", - "assertions": [ + }, { "type": "CheckAction", - "input": "2 === 3", + "input": "a.b++", "expected": null }, { "type": "CheckAction", - "input": "2 !== 3", + "input": "a.b--", "expected": null - } - ] - }, - { - "name": "should parse expressions", - "path": "parser/parseAction/should parse expressions", - "assertions": [ + }, { "type": "CheckAction", - "input": "true && true", + "input": "a[0]++", "expected": null }, { "type": "CheckAction", - "input": "true || false", + "input": "a[0]--", "expected": null }, { "type": "CheckAction", - "input": "null ?? 0", - "expected": null + "input": "this.a++", + "expected": "a++" }, { "type": "CheckAction", - "input": "null ?? undefined ?? 0", - "expected": null - } - ] - }, - { - "name": "should parse typeof expression", - "path": "parser/parseAction/should parse typeof expression", - "assertions": [ + "input": "this.a--", + "expected": "a--" + }, { "type": "CheckAction", - "input": "typeof {} === \"object\"", + "input": "a!++", "expected": null }, { "type": "CheckAction", - "input": "(!(typeof {} === \"number\"))", + "input": "a!--", "expected": null - } - ] - }, - { - "name": "should parse void expression", - "path": "parser/parseAction/should parse void expression", - "assertions": [ + }, { "type": "CheckAction", - "input": "void 0", + "input": "(a)++", "expected": null }, { "type": "CheckAction", - "input": "(!(void 0))", + "input": "(a)--", "expected": null } ] }, { - "name": "should parse grouped expressions", - "path": "parser/parseAction/should parse grouped expressions", + "name": "should parse consecutive unary expressions", + "path": "parser/parseAction/should parse consecutive unary expressions", "assertions": [ { "type": "CheckAction", - "input": "(1 + 2) * 3", - "expected": null - } - ] - }, - { - "name": "should parse in expressions", - "path": "parser/parseAction/should parse in expressions", - "assertions": [ + "input": "- - foo++", + "expected": "- -foo++" + }, { "type": "CheckAction", - "input": "'key' in obj", - "expected": "\"key\" in obj" + "input": "+ + foo++", + "expected": "+ +foo++" }, { "type": "CheckAction", - "input": "('key' in obj) && true", - "expected": "(\"key\" in obj) && true" + "input": "- ++foo", + "expected": "-++foo" }, { "type": "CheckAction", - "input": "'in' in {in: foo}", - "expected": "\"in\" in {in: foo}" - } - ] - }, - { - "name": "should throw on invalid in expressions", - "path": "parser/parseAction/should throw on invalid in expressions", - "assertions": [ - { - "type": "ExpectActionError", - "input": "in", - "error_contains": "Unexpected token in" + "input": "+ --foo", + "expected": "+--foo" }, { - "type": "ExpectActionError", - "input": "in foo", - "error_contains": "Unexpected token in" + "type": "CheckAction", + "input": "a+++b", + "expected": "a++ + b" }, { - "type": "ExpectActionError", - "input": "'foo' in", - "error_contains": "Unexpected end of expression: 'foo' in at the end of the expression ['foo' in]" - } - ] - }, - { - "name": "should ignore comments in expressions", - "path": "parser/parseAction/should ignore comments in expressions", - "assertions": [ + "type": "CheckAction", + "input": "a---b", + "expected": "a-- - b" + }, { "type": "CheckAction", - "input": "a //comment", - "expected": "a" - } - ] - }, - { - "name": "should parse instanceof expressions", - "path": "parser/parseAction/should parse instanceof expressions", - "assertions": [ + "input": "a+++b+++c", + "expected": "a++ + b++ + c" + }, { "type": "CheckAction", - "input": "obj instanceof MyClass", - "expected": "obj instanceof MyClass" + "input": "a+++ +b", + "expected": "a++ + +b" }, { "type": "CheckAction", - "input": "(obj instanceof MyClass) || false", - "expected": "(obj instanceof MyClass) || false" - } - ] - }, - { - "name": "should retain // in string literals", - "path": "parser/parseAction/should retain // in string literals", - "assertions": [ + "input": "a+ ++b", + "expected": "a + ++b" + }, { "type": "CheckAction", - "input": "\"http://www.google.com\"", - "expected": "\"http://www.google.com\"" - } - ] - }, - { - "name": "should parse an empty string", - "path": "parser/parseAction/should parse an empty string", - "assertions": [ + "input": "a- --b", + "expected": "a - --b" + }, { "type": "CheckAction", - "input": "", + "input": "a - -b", "expected": null + }, + { + "type": "CheckAction", + "input": "a + + b", + "expected": "a + +b" } ] }, { - "name": "should parse assignment operators with property reads", - "path": "parser/parseAction/should parse assignment operators with property reads", + "name": "should bind ++ and -- tighter than the other unary operators", + "path": "parser/parseAction/should bind ++ and -- tighter than the other unary operators", "assertions": [ { "type": "CheckAction", - "input": "a = b", + "input": "-a++", "expected": null }, { "type": "CheckAction", - "input": "a += b", + "input": "+a++", "expected": null }, { "type": "CheckAction", - "input": "a -= b", + "input": "!a++", "expected": null }, { "type": "CheckAction", - "input": "a *= b", + "input": "-a--", "expected": null }, { "type": "CheckAction", - "input": "a /= b", + "input": "typeof a++", "expected": null }, { "type": "CheckAction", - "input": "a %= b", + "input": "void a++", "expected": null - }, + } + ] + }, + { + "name": "should allow ++ and -- expressions as operands of other operators", + "path": "parser/parseAction/should allow ++ and -- expressions as operands of other operators", + "assertions": [ { "type": "CheckAction", - "input": "a **= b", + "input": "a++ instanceof b", "expected": null }, { "type": "CheckAction", - "input": "a &&= b", + "input": "a++ in o", "expected": null }, { "type": "CheckAction", - "input": "a ||= b", + "input": "a++ < 3", "expected": null }, { "type": "CheckAction", - "input": "a ??= b", + "input": "a++ * 2", "expected": null - } - ] - }, - { - "name": "should parse assignment operators with keyed reads", - "path": "parser/parseAction/should parse assignment operators with keyed reads", - "assertions": [ + }, { "type": "CheckAction", - "input": "a[0] = b", + "input": "a++ ?? b", "expected": null }, { "type": "CheckAction", - "input": "a[0] += b", + "input": "a ? b++ : c--", "expected": null }, { "type": "CheckAction", - "input": "a[0] -= b", + "input": "o[a++]", "expected": null }, { "type": "CheckAction", - "input": "a[0] *= b", + "input": "f(a++)", "expected": null }, { "type": "CheckAction", - "input": "a[0] /= b", + "input": "[a++]", "expected": null }, { "type": "CheckAction", - "input": "a[0] %= b", + "input": "{x: a++}", "expected": null }, { "type": "CheckAction", - "input": "a[0] **= b", + "input": "c = a++", "expected": null }, { "type": "CheckAction", - "input": "a[0] &&= b", + "input": "c += a++", "expected": null }, { "type": "CheckAction", - "input": "a[0] ||= b", + "input": "a.b[c++].d++", "expected": null }, { "type": "CheckAction", - "input": "a[0] ??= b", + "input": "a++ + ++a", "expected": null } ] @@ -2219,6 +2970,37 @@ } ] }, + { + "name": "should parse an arrow function containing update operators", + "path": "parser/parseBinding/arrow functions/should parse an arrow function containing update operators", + "assertions": [ + { + "type": "CheckBinding", + "input": "a => a++", + "expected": null + }, + { + "type": "CheckBinding", + "input": "a => a--", + "expected": null + }, + { + "type": "CheckBinding", + "input": "a => ++a", + "expected": null + }, + { + "type": "CheckBinding", + "input": "a => --a", + "expected": null + }, + { + "type": "CheckBinding", + "input": "(a) => a++", + "expected": "a => a++" + } + ] + }, { "name": "should be able to pass an arrow function through a pipe", "path": "parser/parseBinding/arrow functions/should be able to pass an arrow function through a pipe", @@ -2260,6 +3042,11 @@ "path": "parser/parseBinding/should report assignment", "assertions": [] }, + { + "name": "should report update operators in bindings", + "path": "parser/parseBinding/should report update operators in bindings", + "assertions": [] + }, { "name": "should report when encountering interpolation", "path": "parser/parseBinding/should report when encountering interpolation", @@ -2520,6 +3307,11 @@ "path": "parser/parseInterpolation/comments/should retain // in nested, unterminated strings", "assertions": [] }, + { + "name": "should ignore escaped quotes when looking for comments", + "path": "parser/parseInterpolation/comments/should ignore escaped quotes when looking for comments", + "assertions": [] + }, { "name": "should ignore quotes inside a comment", "path": "parser/parseInterpolation/comments/should ignore quotes inside a comment", @@ -2638,8 +3430,8 @@ ] }, { - "name": "should report when encountering field write", - "path": "parser/parseSimpleBinding/should report when encountering field write", + "name": "should report when encountering field write or update operators", + "path": "parser/parseSimpleBinding/should report when encountering field write or update operators", "assertions": [] }, { diff --git a/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json b/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json index 609823cf95..8124dd6e4e 100644 --- a/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json @@ -348,6 +348,54 @@ "expected": "foo instanceof Bar" } ] + }, + { + "name": "should serialize prefix increment and decrement", + "path": "serializer/serialize/should serialize prefix increment and decrement", + "assertions": [ + { + "type": "SerializeExpression", + "input": " ++ foo ", + "expected": "++foo" + }, + { + "type": "SerializeExpression", + "input": " -- foo ", + "expected": "--foo" + } + ] + }, + { + "name": "should serialize postfix increment and decrement", + "path": "serializer/serialize/should serialize postfix increment and decrement", + "assertions": [ + { + "type": "SerializeExpression", + "input": " foo ++ ", + "expected": "foo++" + }, + { + "type": "SerializeExpression", + "input": " foo -- ", + "expected": "foo--" + } + ] + }, + { + "name": "should separate unary operators next to each other", + "path": "serializer/serialize/should separate unary operators next to each other", + "assertions": [ + { + "type": "SerializeExpression", + "input": " + ++foo ", + "expected": "+ ++foo" + }, + { + "type": "SerializeExpression", + "input": " - --foo ", + "expected": "- --foo" + } + ] } ] } diff --git a/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json b/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json index f2573a382b..f576ba3706 100644 --- a/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json @@ -13,7 +13,9 @@ { "type": "SerializeNodes", "input": "

", - "expected": ["

"] + "expected": [ + "

" + ] } ] }, @@ -24,7 +26,9 @@ { "type": "SerializeNodes", "input": "

", - "expected": ["

"] + "expected": [ + "

" + ] } ] }, @@ -35,7 +39,9 @@ { "type": "SerializeNodes", "input": "some text", - "expected": ["some text"] + "expected": [ + "some text" + ] } ] }, @@ -46,7 +52,9 @@ { "type": "SerializeNodes", "input": "{number, plural, =0 {none} =1 {one} other {many}}", - "expected": ["{number, plural, =0 {none} =1 {one} other {many}}"] + "expected": [ + "{number, plural, =0 {none} =1 {one} other {many}}" + ] } ] }, @@ -57,7 +65,9 @@ { "type": "SerializeNodes", "input": "", - "expected": [""] + "expected": [ + "" + ] } ] }, diff --git a/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json b/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json index 440d49118a..e58fbdd5d2 100644 --- a/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json @@ -19,7 +19,16 @@ { "type": "HumanizeDom", "input": "a", - "expected": [["html.Text", "a", 0.0, ["a"]]] + "expected": [ + [ + "html.Text", + "a", + 0.0, + [ + "a" + ] + ] + ] } ] }, @@ -31,8 +40,19 @@ "type": "HumanizeDom", "input": "
a
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "a", 1.0, ["a"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "a", + 1.0, + [ + "a" + ] + ] ] } ] @@ -45,8 +65,19 @@ "type": "HumanizeDom", "input": "a", "expected": [ - ["html.Element", "ng-template", 0.0], - ["html.Text", "a", 1.0, ["a"]] + [ + "html.Element", + "ng-template", + 0.0 + ], + [ + "html.Text", + "a", + 1.0, + [ + "a" + ] + ] ] } ] @@ -58,7 +89,16 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Text", "text", 0.0, ["text"]]] + "expected": [ + [ + "html.Text", + "text", + 0.0, + [ + "text" + ] + ] + ] } ] }, @@ -70,8 +110,26 @@ "type": "HumanizeDom", "input": "
🛈
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "🛈", 1.0, [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "🛈", + 1.0, + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] ] } ] @@ -84,8 +142,26 @@ "type": "HumanizeDom", "input": "
🛈
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "🛈", 1.0, [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "🛈", + 1.0, + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] ] } ] @@ -98,16 +174,52 @@ "type": "HumanizeDom", "input": "
¹
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "¹", 1.0, [""], ["¹", "¹"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "¹", + 1.0, + [ + "" + ], + [ + "¹", + "¹" + ], + [ + "" + ] + ] ] }, { "type": "HumanizeDom", "input": "
½
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "½", 1.0, [""], ["½", "½"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "½", + 1.0, + [ + "" + ], + [ + "½", + "½" + ], + [ + "" + ] + ] ] } ] @@ -130,7 +242,13 @@ { "type": "HumanizeDom", "input": "
", - "expected": [["html.Element", "div", 0.0]] + "expected": [ + [ + "html.Element", + "div", + 0.0 + ] + ] } ] }, @@ -142,8 +260,16 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Element", "span", 1.0] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Element", + "span", + 1.0 + ] ] } ] @@ -156,8 +282,16 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", "ng-template", 0.0], - ["html.Element", "span", 1.0] + [ + "html.Element", + "ng-template", + 0.0 + ], + [ + "html.Element", + "span", + 1.0 + ] ] } ] @@ -170,9 +304,27 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", "link", 0.0], - ["html.Attribute", "rel", "author license", ["author license"]], - ["html.Attribute", "href", "/about", ["/about"]] + [ + "html.Element", + "link", + 0.0 + ], + [ + "html.Attribute", + "rel", + "author license", + [ + "author license" + ] + ], + [ + "html.Attribute", + "href", + "/about", + [ + "/about" + ] + ] ] } ] @@ -195,10 +347,32 @@ "type": "HumanizeDom", "input": "

before
after

", "expected": [ - ["html.Element", "p", 0.0], - ["html.Text", "before", 1.0, ["before"]], - ["html.Element", "br", 1.0], - ["html.Text", "after", 1.0, ["after"]] + [ + "html.Element", + "p", + 0.0 + ], + [ + "html.Text", + "before", + 1.0, + [ + "before" + ] + ], + [ + "html.Element", + "br", + 1.0 + ], + [ + "html.Text", + "after", + 1.0, + [ + "after" + ] + ] ] } ] @@ -211,11 +385,37 @@ "type": "HumanizeDom", "input": "

1

2

", "expected": [ - ["html.Element", "div", 0.0], - ["html.Element", "p", 1.0], - ["html.Text", "1", 2.0, ["1"]], - ["html.Element", "p", 1.0], - ["html.Text", "2", 2.0, ["2"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Element", + "p", + 1.0 + ], + [ + "html.Text", + "1", + 2.0, + [ + "1" + ] + ], + [ + "html.Element", + "p", + 1.0 + ], + [ + "html.Text", + "2", + 2.0, + [ + "2" + ] + ] ] } ] @@ -228,10 +428,26 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", "ul", 0.0], - ["html.Element", "li", 1.0], - ["html.Element", "ul", 2.0], - ["html.Element", "li", 3.0] + [ + "html.Element", + "ul", + 0.0 + ], + [ + "html.Element", + "li", + 1.0 + ], + [ + "html.Element", + "ul", + 2.0 + ], + [ + "html.Element", + "li", + 3.0 + ] ] } ] @@ -244,8 +460,16 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Element", "tr", 1.0] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Element", + "tr", + 1.0 + ] ] } ] @@ -257,7 +481,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":myns:div", 0.0]] + "expected": [ + [ + "html.Element", + ":myns:div", + 0.0 + ] + ] } ] }, @@ -268,7 +498,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":svg:svg", 0.0]] + "expected": [ + [ + "html.Element", + ":svg:svg", + 0.0 + ] + ] } ] }, @@ -280,8 +516,16 @@ "type": "HumanizeDom", "input": "

", "expected": [ - ["html.Element", ":myns:div", 0.0], - ["html.Element", ":myns:p", 1.0] + [ + "html.Element", + ":myns:div", + 0.0 + ], + [ + "html.Element", + ":myns:p", + 1.0 + ] ] } ] @@ -298,7 +542,14 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", "input", 0.0, "#selfClosing"]] + "expected": [ + [ + "html.Element", + "input", + 0.0, + "#selfClosing" + ] + ] } ] }, @@ -309,7 +560,14 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":math:math", 0.0, "#selfClosing"]] + "expected": [ + [ + "html.Element", + ":math:math", + 0.0, + "#selfClosing" + ] + ] } ] }, @@ -321,13 +579,50 @@ "type": "HumanizeDom", "input": "

\n

\n\n
\n\n", "expected": [ - ["html.Element", "p", 0.0], - ["html.Text", "\n", 1.0, ["\n"]], - ["html.Element", "textarea", 0.0], - ["html.Element", "pre", 0.0], - ["html.Text", "\n", 1.0, ["\n"]], - ["html.Element", "listing", 0.0], - ["html.Text", "\n", 1.0, ["\n"]] + [ + "html.Element", + "p", + 0.0 + ], + [ + "html.Text", + "\n", + 1.0, + [ + "\n" + ] + ], + [ + "html.Element", + "textarea", + 0.0 + ], + [ + "html.Element", + "pre", + 0.0 + ], + [ + "html.Text", + "\n", + 1.0, + [ + "\n" + ] + ], + [ + "html.Element", + "listing", + 0.0 + ], + [ + "html.Text", + "\n", + 1.0, + [ + "\n" + ] + ] ] } ] @@ -344,7 +639,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", "constructor", 0.0]] + "expected": [ + [ + "html.Element", + "constructor", + 0.0 + ] + ] } ] } @@ -365,8 +666,19 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "animate.enter", "foo", ["foo"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "animate.enter", + "foo", + [ + "foo" + ] + ] ] } ] @@ -379,8 +691,19 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "animate.leave", "bar", ["bar"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "animate.leave", + "bar", + [ + "bar" + ] + ] ] } ] @@ -393,8 +716,19 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "animateAbc", "bar", ["bar"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "animateAbc", + "bar", + [ + "bar" + ] + ] ] } ] @@ -407,9 +741,27 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "animate.enter", "foo", ["foo"]], - ["html.Attribute", "animate.leave", "bar", ["bar"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "animate.enter", + "foo", + [ + "foo" + ] + ], + [ + "html.Attribute", + "animate.leave", + "bar", + [ + "bar" + ] + ] ] } ] @@ -422,8 +774,19 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "[animate.enter]", "'foo'", ["'foo'"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "[animate.enter]", + "'foo'", + [ + "'foo'" + ] + ] ] } ] @@ -436,12 +799,18 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "[animate.leave]", "['bar', 'baz']", - ["['bar', 'baz']"] + [ + "['bar', 'baz']" + ] ] ] } @@ -455,12 +824,18 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "(animate.enter)", "onAnimation($event)", - ["onAnimation($event)"] + [ + "onAnimation($event)" + ] ] ] } @@ -474,12 +849,18 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "(animate.leave)", "onAnimation($event)", - ["onAnimation($event)"] + [ + "onAnimation($event)" + ] ] ] } @@ -493,8 +874,19 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "(animateXYZ)", "onAnimation()", ["onAnimation()"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "(animateXYZ)", + "onAnimation()", + [ + "onAnimation()" + ] + ] ] } ] @@ -507,13 +899,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "[animate.enter]", "'foo'", ["'foo'"]], + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "[animate.enter]", + "'foo'", + [ + "'foo'" + ] + ], [ "html.Attribute", "(animate.leave)", "onAnimation($event)", - ["onAnimation($event)"] + [ + "onAnimation($event)" + ] ] ] } @@ -531,9 +936,27 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "kEy", "v", ["v"]], - ["html.Attribute", "key2", "v2", ["v2"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "kEy", + "v", + [ + "v" + ] + ], + [ + "html.Attribute", + "key2", + "v2", + [ + "v2" + ] + ] ] } ] @@ -546,14 +969,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "foo", "1{{message}}2", - ["1"], - ["{{", "message", "}}"], - ["2"] + [ + "1" + ], + [ + "{{", + "message", + "}}" + ], + [ + "2" + ] ] ] } @@ -567,14 +1002,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "foo", "{{message}}", - [""], - ["{{", "message", "}}"], - [""] + [ + "" + ], + [ + "{{", + "message", + "}}" + ], + [ + "" + ] ] ] } @@ -593,8 +1040,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "&", [""], ["&", "&"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "foo", + "&", + [ + "" + ], + [ + "&", + "&" + ], + [ + "" + ] + ] ] } ] @@ -607,8 +1072,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "🛈", [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "foo", + "🛈", + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] ] } ] @@ -621,8 +1104,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "🛈", [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "foo", + "🛈", + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] ] } ] @@ -647,9 +1148,17 @@ "html.Attribute", "foo", "{{&}}", - [""], - ["{{", "&", "}}"], - [""], + [ + "" + ], + [ + "{{", + "&", + "}}" + ], + [ + "" + ], "foo=\"{{&}}\"" ] ], @@ -657,6 +1166,39 @@ } ] }, + { + "name": "should avoid walking the prototype when looking up entity names", + "path": "HtmlParser/parse/attributes/should avoid walking the prototype when looking up entity names", + "assertions": [ + { + "type": "HumanizeDom", + "input": "

{{ &constructor; }}

", + "expected": [ + [ + "html.Element", + "p", + 0.0 + ], + [ + "html.Text", + "{{ &constructor; }}", + 1.0, + [ + "" + ], + [ + "{{", + " &constructor; ", + "}}" + ], + [ + "" + ] + ] + ] + } + ] + }, { "name": "should normalize line endings within attribute values", "path": "HtmlParser/parse/attributes/should normalize line endings within attribute values", @@ -670,8 +1212,16 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "k", ""] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "k", + "" + ] ] } ] @@ -684,8 +1234,19 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", ":svg:svg", 0.0], - ["html.Attribute", "viewBox", "0", ["0"]] + [ + "html.Element", + ":svg:svg", + 0.0 + ], + [ + "html.Attribute", + "viewBox", + "0", + [ + "0" + ] + ] ] } ] @@ -698,8 +1259,19 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", "ng-template", 0.0], - ["html.Attribute", "k", "v", ["v"]] + [ + "html.Element", + "ng-template", + 0.0 + ], + [ + "html.Attribute", + "k", + "v", + [ + "v" + ] + ] ] } ] @@ -712,8 +1284,20 @@ "type": "HumanizeDom", "input": "", "expected": [ - ["html.Element", ":svg:use", 0.0, "#selfClosing"], - ["html.Attribute", ":xlink:href", "Port", ["Port"]] + [ + "html.Element", + ":svg:use", + 0.0, + "#selfClosing" + ], + [ + "html.Attribute", + ":xlink:href", + "Port", + [ + "Port" + ] + ] ] } ] @@ -742,8 +1326,16 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Comment", "comment", 0.0], - ["html.Element", "div", 0.0] + [ + "html.Comment", + "comment", + 0.0 + ], + [ + "html.Element", + "div", + 0.0 + ] ] } ] @@ -755,7 +1347,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Comment", "line 1 \n line 2", 0.0]] + "expected": [ + [ + "html.Comment", + "line 1 \n line 2", + 0.0 + ] + ] } ] } @@ -859,10 +1457,27 @@ "type": "HumanizeDom", "input": "@defer (a b; c d){hello}", "expected": [ - ["html.Block", "defer", 0.0], - ["html.BlockParameter", "a b"], - ["html.BlockParameter", "c d"], - ["html.Text", "hello", 1.0, ["hello"]] + [ + "html.Block", + "defer", + 0.0 + ], + [ + "html.BlockParameter", + "a b" + ], + [ + "html.BlockParameter", + "c d" + ], + [ + "html.Text", + "hello", + 1.0, + [ + "hello" + ] + ] ] } ] @@ -875,8 +1490,17 @@ "type": "HumanizeDom", "input": "@defer {}", "expected": [ - ["html.Block", "defer", 0.0], - ["html.Element", "my-cmp", 1.0, "#selfClosing"] + [ + "html.Block", + "defer", + 0.0 + ], + [ + "html.Element", + "my-cmp", + 1.0, + "#selfClosing" + ] ] } ] @@ -899,10 +1523,26 @@ "type": "HumanizeDom", "input": "@if (cond) {}", "expected": [ - ["html.Element", ":svg:svg", 0.0], - ["html.Block", "if", 1.0], - ["html.BlockParameter", "cond"], - ["html.Element", ":svg:circle", 2.0, "#selfClosing"] + [ + "html.Element", + ":svg:svg", + 0.0 + ], + [ + "html.Block", + "if", + 1.0 + ], + [ + "html.BlockParameter", + "cond" + ], + [ + "html.Element", + ":svg:circle", + 2.0, + "#selfClosing" + ] ] } ] @@ -914,7 +1554,13 @@ { "type": "HumanizeDom", "input": "@defer{}", - "expected": [["html.Block", "defer", 0.0]] + "expected": [ + [ + "html.Block", + "defer", + 0.0 + ] + ] } ] }, @@ -926,8 +1572,16 @@ "type": "HumanizeDom", "input": "@defer {
}", "expected": [ - ["html.Block", "defer", 0.0], - ["html.Element", "br", 1.0] + [ + "html.Block", + "defer", + 0.0 + ], + [ + "html.Element", + "br", + 1.0 + ] ] } ] @@ -940,15 +1594,54 @@ "type": "HumanizeDom", "input": "@switch (expr) {@case ('foo') @case ('bar') { }}", "expected": [ - ["html.Block", "switch", 0.0], - ["html.BlockParameter", "expr"], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'foo'"], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'bar'"], - ["html.Text", " ", 2.0, [" "]], - ["html.Element", "input", 2.0], - ["html.Text", " ", 2.0, [" "]] + [ + "html.Block", + "switch", + 0.0 + ], + [ + "html.BlockParameter", + "expr" + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'foo'" + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'bar'" + ], + [ + "html.Text", + " ", + 2.0, + [ + " " + ] + ], + [ + "html.Element", + "input", + 2.0 + ], + [ + "html.Text", + " ", + 2.0, + [ + " " + ] + ] ] } ] @@ -961,18 +1654,74 @@ "type": "HumanizeDom", "input": "@switch (expr) {@case ('foo') {} @case ('bar') {bar} @case('baz') { baz }}", "expected": [ - ["html.Block", "switch", 0.0], - ["html.BlockParameter", "expr"], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'foo'"], - ["html.Text", " ", 1.0, [" "]], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'bar'"], - ["html.Text", "bar", 2.0, ["bar"]], - ["html.Text", " ", 1.0, [" "]], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'baz'"], - ["html.Text", " baz ", 2.0, [" baz "]] + [ + "html.Block", + "switch", + 0.0 + ], + [ + "html.BlockParameter", + "expr" + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'foo'" + ], + [ + "html.Text", + " ", + 1.0, + [ + " " + ] + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'bar'" + ], + [ + "html.Text", + "bar", + 2.0, + [ + "bar" + ] + ], + [ + "html.Text", + " ", + 1.0, + [ + " " + ] + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'baz'" + ], + [ + "html.Text", + " baz ", + 2.0, + [ + " baz " + ] + ] ] } ] @@ -985,12 +1734,37 @@ "type": "HumanizeDom", "input": "@switch (expr) {@case ('foo') {} @default never;}", "expected": [ - ["html.Block", "switch", 0.0], - ["html.BlockParameter", "expr"], - ["html.Block", "case", 1.0], - ["html.BlockParameter", "'foo'"], - ["html.Text", " ", 1.0, [" "]], - ["html.Block", "default never", 1.0] + [ + "html.Block", + "switch", + 0.0 + ], + [ + "html.BlockParameter", + "expr" + ], + [ + "html.Block", + "case", + 1.0 + ], + [ + "html.BlockParameter", + "'foo'" + ], + [ + "html.Text", + " ", + 1.0, + [ + " " + ] + ], + [ + "html.Block", + "default never", + 1.0 + ] ] } ] @@ -1003,9 +1777,24 @@ "type": "HumanizeDom", "input": "@defer {hello}", "expected": [ - ["html.Element", "img", 0.0], - ["html.Block", "defer", 0.0], - ["html.Text", "hello", 1.0, ["hello"]] + [ + "html.Element", + "img", + 0.0 + ], + [ + "html.Block", + "defer", + 0.0 + ], + [ + "html.Text", + "hello", + 1.0, + [ + "hello" + ] + ] ] } ] @@ -1063,7 +1852,13 @@ { "type": "HumanizeDom", "input": "@let foo = 123;", - "expected": [["html.LetDeclaration", "foo", "123"]] + "expected": [ + [ + "html.LetDeclaration", + "foo", + "123" + ] + ] } ] }, @@ -1075,10 +1870,25 @@ "type": "HumanizeDom", "input": "@defer {@if (true) {@let foo = 123;}}", "expected": [ - ["html.Block", "defer", 0.0], - ["html.Block", "if", 1.0], - ["html.BlockParameter", "true"], - ["html.LetDeclaration", "foo", "123"] + [ + "html.Block", + "defer", + 0.0 + ], + [ + "html.Block", + "if", + 1.0 + ], + [ + "html.BlockParameter", + "true" + ], + [ + "html.LetDeclaration", + "foo", + "123" + ] ] } ] @@ -1318,6 +2128,52 @@ } ] }, + { + "name": "ignored syntax", + "groups": [], + "tests": [ + { + "name": "should ignore doctype declaration", + "path": "HtmlParser/parse/ignored syntax/should ignore doctype declaration", + "assertions": [ + { + "type": "HumanizeDom", + "input": "hello", + "expected": [ + [ + "html.Text", + "hello", + 0.0, + [ + "hello" + ] + ] + ] + } + ] + }, + { + "name": "should ignore processing instruction", + "path": "HtmlParser/parse/ignored syntax/should ignore processing instruction", + "assertions": [ + { + "type": "HumanizeDom", + "input": "hello", + "expected": [ + [ + "html.Text", + "hello", + 0.0, + [ + "hello" + ] + ] + ] + } + ] + } + ] + }, { "name": "source spans", "groups": [], @@ -1338,11 +2194,48 @@ "
", "
" ], - ["html.Attribute", "[prop]", "v1", ["v1"], "[prop]=\"v1\""], - ["html.Attribute", "(e)", "do()", ["do()"], "(e)=\"do()\""], - ["html.Attribute", "attr", "v2", ["v2"], "attr=\"v2\""], - ["html.Attribute", "noValue", "", "noValue"], - ["html.Text", "\na\n", 1.0, ["\na\n"], "\na\n"] + [ + "html.Attribute", + "[prop]", + "v1", + [ + "v1" + ], + "[prop]=\"v1\"" + ], + [ + "html.Attribute", + "(e)", + "do()", + [ + "do()" + ], + "(e)=\"do()\"" + ], + [ + "html.Attribute", + "attr", + "v2", + [ + "v2" + ], + "attr=\"v2\"" + ], + [ + "html.Attribute", + "noValue", + "", + "noValue" + ], + [ + "html.Text", + "\na\n", + 1.0, + [ + "\na\n" + ], + "\na\n" + ] ], "options": null } @@ -1383,9 +2276,17 @@ "html.Text", " pre {{ value }} post ", 1.0, - [" pre "], - ["{{", " value ", "}}"], - [" post "], + [ + " pre " + ], + [ + "{{", + " value ", + "}}" + ], + [ + " post " + ], " pre {{ value }} post " ] ], @@ -1401,8 +2302,22 @@ "type": "HumanizeDomSourceSpans", "input": "

", "expected": [ - ["html.Element", "div", 0.0, "

", "
", "
"], - ["html.Element", "br", 1.0, "
", "
", null] + [ + "html.Element", + "div", + 0.0, + "

", + "
", + "
" + ], + [ + "html.Element", + "br", + 1.0, + "
", + "
", + null + ] ], "options": null } @@ -1416,9 +2331,30 @@ "type": "HumanizeDomSourceSpans", "input": "


", "expected": [ - ["html.Element", "div", 0.0, "


", "
", "
"], - ["html.Element", "br", 1.0, "
", "
", null], - ["html.Element", "hr", 1.0, "
", "
", null] + [ + "html.Element", + "div", + 0.0, + "


", + "
", + "
" + ], + [ + "html.Element", + "br", + 1.0, + "
", + "
", + null + ], + [ + "html.Element", + "hr", + 1.0, + "
", + "
", + null + ] ], "options": null } @@ -1431,7 +2367,16 @@ { "type": "HumanizeDomSourceSpans", "input": "
", - "expected": [["html.Element", "br", 0.0, "
", "
", null]], + "expected": [ + [ + "html.Element", + "br", + 0.0, + "
", + "
", + null + ] + ], "options": null } ] @@ -1444,7 +2389,15 @@ "type": "HumanizeDomSourceSpans", "input": "
", "expected": [ - ["html.Element", "br", 0.0, "
", "#selfClosing", "
", "
"] + [ + "html.Element", + "br", + 0.0, + "
", + "#selfClosing", + "
", + "
" + ] ], "options": null } @@ -1458,8 +2411,23 @@ "type": "HumanizeDomSourceSpans", "input": "

", "expected": [ - ["html.Element", "div", 0.0, "

", "
", "
"], - ["html.Element", "br", 1.0, "
", "#selfClosing", "
", "
"] + [ + "html.Element", + "div", + 0.0, + "

", + "
", + "
" + ], + [ + "html.Element", + "br", + 1.0, + "
", + "#selfClosing", + "
", + "
" + ] ], "options": null } @@ -1482,13 +2450,51 @@ "", "" ], - ["html.Attribute", "type", "text", ["text"], "type=\"text\""], - ["html.Text", "\n\n\n ", 0.0, ["\n\n\n "], "", "\n\n\n "], - ["html.Element", "span", 0.0, "\n", "", ""], - ["html.Text", "\n", 1.0, ["\n"], "", "\n"] + [ + "html.Attribute", + "type", + "text", + [ + "text" + ], + "type=\"text\"" + ], + [ + "html.Text", + "\n\n\n ", + 0.0, + [ + "\n\n\n " + ], + "", + "\n\n\n " + ], + [ + "html.Element", + "span", + 0.0, + "\n", + "", + "" + ], + [ + "html.Text", + "\n", + 1.0, + [ + "\n" + ], + "", + "\n" + ] ], "options": { - "leading_trivia_chars": [" ", "\n", "\r", "\t"] + "leading_trivia_chars": [ + " ", + "\n", + "\r", + "\t" + ] } } ] @@ -1501,8 +2507,22 @@ "type": "HumanizeDomSourceSpans", "input": "

", "expected": [ - ["html.Element", "div", 0.0, "

", "
", "
"], - ["html.Element", "p", 1.0, "

", "

", null] + [ + "html.Element", + "div", + 0.0, + "

", + "
", + "
" + ], + [ + "html.Element", + "p", + 1.0, + "

", + "

", + null + ] ], "options": null }, @@ -1510,11 +2530,48 @@ "type": "HumanizeDomSourceSpans", "input": "

  • A
  • B
  • ", "expected": [ - ["html.Element", "div", 0.0, "
  • A
  • B
  • ", "
    ", "
    "], - ["html.Element", "li", 1.0, "
  • ", "
  • ", null], - ["html.Text", "A", 2.0, ["A"], "A"], - ["html.Element", "li", 1.0, "
  • ", "
  • ", null], - ["html.Text", "B", 2.0, ["B"], "B"] + [ + "html.Element", + "div", + 0.0, + "
  • A
  • B", + "
    ", + "
    " + ], + [ + "html.Element", + "li", + 1.0, + "
  • ", + "
  • ", + null + ], + [ + "html.Text", + "A", + 2.0, + [ + "A" + ], + "A" + ], + [ + "html.Element", + "li", + 1.0, + "
  • ", + "
  • ", + null + ], + [ + "html.Text", + "B", + 2.0, + [ + "B" + ], + "B" + ] ], "options": null } @@ -1536,8 +2593,19 @@ "
    ", "
    " ], - ["html.Expansion", "count", "plural", 1.0, "{count, plural, =0 {msg}}"], - ["html.ExpansionCase", "=0", 2.0, "=0 {msg}"] + [ + "html.Expansion", + "count", + "plural", + 1.0, + "{count, plural, =0 {msg}}" + ], + [ + "html.ExpansionCase", + "=0", + 2.0, + "=0 {msg}" + ] ], "options": null } diff --git a/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json b/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json index 5a3474cdb0..a606da7560 100644 --- a/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json @@ -44,10 +44,26 @@ "type": "ParseAndRemoveWhitespace", "input": "

    \t
    \n
    ", "expected": [ - ["html.Element", "br", 0.0], - ["html.Element", "br", 0.0], - ["html.Element", "br", 0.0], - ["html.Element", "br", 0.0] + [ + "html.Element", + "br", + 0.0 + ], + [ + "html.Element", + "br", + 0.0 + ], + [ + "html.Element", + "br", + 0.0 + ], + [ + "html.Element", + "br", + 0.0 + ] ], "options": null } @@ -61,8 +77,16 @@ "type": "ParseAndRemoveWhitespace", "input": "
    ", "expected": [ - ["html.Element", "div", 0.0], - ["html.Element", "span", 1.0] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Element", + "span", + 1.0 + ] ], "options": null } @@ -75,7 +99,13 @@ { "type": "ParseAndRemoveWhitespace", "input": "
    \t", - "expected": [["html.Element", "br", 0.0]], + "expected": [ + [ + "html.Element", + "br", + 0.0 + ] + ], "options": null } ] @@ -88,12 +118,52 @@ "type": "ParseAndRemoveWhitespace", "input": "
    foo&ngsp;bar
    ", "expected": [ - ["html.Element", "div", 0.0], - ["html.Element", "span", 1.0], - ["html.Text", "foo", 2.0, ["foo"]], - ["html.Text", " ", 1.0, [""], ["NGSP_UNICODE", "&ngsp;"], [""]], - ["html.Element", "span", 1.0], - ["html.Text", "bar", 2.0, ["bar"]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Element", + "span", + 1.0 + ], + [ + "html.Text", + "foo", + 2.0, + [ + "foo" + ] + ], + [ + "html.Text", + " ", + 1.0, + [ + "" + ], + [ + "NGSP_UNICODE", + "&ngsp;" + ], + [ + "" + ] + ], + [ + "html.Element", + "span", + 1.0 + ], + [ + "html.Text", + "bar", + 2.0, + [ + "bar" + ] + ] ], "options": null } @@ -106,13 +176,31 @@ { "type": "ParseAndRemoveWhitespace", "input": "\n\n\nfoo\t\t\t", - "expected": [["html.Text", " foo ", 0.0, [" foo "]]], + "expected": [ + [ + "html.Text", + " foo ", + 0.0, + [ + " foo " + ] + ] + ], "options": null }, { "type": "ParseAndRemoveWhitespace", "input": " \n foo \t ", - "expected": [["html.Text", " foo ", 0.0, [" foo "]]], + "expected": [ + [ + "html.Text", + " foo ", + 0.0, + [ + " foo " + ] + ] + ], "options": null } ] @@ -129,7 +217,23 @@ { "type": "ParseAndRemoveWhitespace", "input": " ", - "expected": [["html.Text", " ", 0.0, [""], [" ", " "], [""]]], + "expected": [ + [ + "html.Text", + " ", + 0.0, + [ + "" + ], + [ + " ", + " " + ], + [ + "" + ] + ] + ], "options": null } ] @@ -146,15 +250,37 @@ "html.Text", "  foo  ", 0.0, - [""], - [" ", " "], - [""], - [" ", " "], - ["foo"], - [" ", " "], - [""], - [" ", " "], - [""] + [ + "" + ], + [ + " ", + " " + ], + [ + "" + ], + [ + " ", + " " + ], + [ + "foo" + ], + [ + " ", + " " + ], + [ + "" + ], + [ + " ", + " " + ], + [ + "" + ] ] ], "options": null @@ -168,13 +294,31 @@ { "type": "ParseAndRemoveWhitespace", "input": "\nfoo", - "expected": [["html.Text", "\nfoo", 0.0, ["\nfoo"]]], + "expected": [ + [ + "html.Text", + "\nfoo", + 0.0, + [ + "\nfoo" + ] + ] + ], "options": null }, { "type": "ParseAndRemoveWhitespace", "input": "\tfoo", - "expected": [["html.Text", "\tfoo", 0.0, ["\tfoo"]]], + "expected": [ + [ + "html.Text", + "\tfoo", + 0.0, + [ + "\tfoo" + ] + ] + ], "options": null } ] @@ -191,11 +335,25 @@ "html.Text", "{{fooExp}} {{barExp}}", 0.0, - [""], - ["{{", "fooExp", "}}"], - [" "], - ["{{", "barExp", "}}"], - [""] + [ + "" + ], + [ + "{{", + "fooExp", + "}}" + ], + [ + " " + ], + [ + "{{", + "barExp", + "}}" + ], + [ + "" + ] ] ], "options": null @@ -208,11 +366,25 @@ "html.Text", "{{fooExp}}\t{{barExp}}", 0.0, - [""], - ["{{", "fooExp", "}}"], - ["\t"], - ["{{", "barExp", "}}"], - [""] + [ + "" + ], + [ + "{{", + "fooExp", + "}}" + ], + [ + "\t" + ], + [ + "{{", + "barExp", + "}}" + ], + [ + "" + ] ] ], "options": null @@ -225,11 +397,25 @@ "html.Text", "{{fooExp}}\n{{barExp}}", 0.0, - [""], - ["{{", "fooExp", "}}"], - ["\n"], - ["{{", "barExp", "}}"], - [""] + [ + "" + ], + [ + "{{", + "fooExp", + "}}" + ], + [ + "\n" + ], + [ + "{{", + "barExp", + "}}" + ], + [ + "" + ] ] ], "options": null @@ -243,7 +429,24 @@ { "type": "ParseAndRemoveWhitespace", "input": " {{exp}} ", - "expected": [["html.Text", " {{exp}} ", 0.0, [" "], ["{{", "exp", "}}"], [" "]]], + "expected": [ + [ + "html.Text", + " {{exp}} ", + 0.0, + [ + " " + ], + [ + "{{", + "exp", + "}}" + ], + [ + " " + ] + ] + ], "options": null } ] @@ -256,11 +459,38 @@ "type": "ParseAndRemoveWhitespace", "input": " {a, b, =4 {c}} ", "expected": [ - ["html.Element", "span", 0.0], - ["html.Text", " ", 1.0, [" "]], - ["html.Expansion", "a", "b", 1.0], - ["html.ExpansionCase", "=4", 2.0], - ["html.Text", " ", 1.0, [" "]] + [ + "html.Element", + "span", + 0.0 + ], + [ + "html.Text", + " ", + 1.0, + [ + " " + ] + ], + [ + "html.Expansion", + "a", + "b", + 1.0 + ], + [ + "html.ExpansionCase", + "=4", + 2.0 + ], + [ + "html.Text", + " ", + 1.0, + [ + " " + ] + ] ], "options": { "tokenize_expansion_forms": true, @@ -281,12 +511,45 @@ "type": "ParseAndRemoveWhitespace", "input": "
    foo\nbar
    ", "expected": [ - ["html.Element", "pre", 0.0], - ["html.Element", "strong", 1.0], - ["html.Text", "foo", 2.0, ["foo"]], - ["html.Text", "\n", 1.0, ["\n"]], - ["html.Element", "strong", 1.0], - ["html.Text", "bar", 2.0, ["bar"]] + [ + "html.Element", + "pre", + 0.0 + ], + [ + "html.Element", + "strong", + 1.0 + ], + [ + "html.Text", + "foo", + 2.0, + [ + "foo" + ] + ], + [ + "html.Text", + "\n", + 1.0, + [ + "\n" + ] + ], + [ + "html.Element", + "strong", + 1.0 + ], + [ + "html.Text", + "bar", + 2.0, + [ + "bar" + ] + ] ], "options": null } @@ -300,8 +563,19 @@ "type": "ParseAndRemoveWhitespace", "input": "", "expected": [ - ["html.Element", "textarea", 0.0], - ["html.Text", "foo\n\n bar", 1.0, ["foo\n\n bar"]] + [ + "html.Element", + "textarea", + 0.0 + ], + [ + "html.Text", + "foo\n\n bar", + 1.0, + [ + "foo\n\n bar" + ] + ] ], "options": null } diff --git a/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json b/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json index 8a0daaa991..868ec7e04f 100644 --- a/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json @@ -18,11 +18,26 @@ "input": "a", "test_type": "HumanizeLineColumn", "expected": [ - ["TokenType.TAG_OPEN_START", "0:0"], - ["TokenType.TAG_OPEN_END", "0:2"], - ["TokenType.TEXT", "0:3"], - ["TokenType.TAG_CLOSE", "0:4"], - ["TokenType.EOF", "0:8"] + [ + "TokenType.TAG_OPEN_START", + "0:0" + ], + [ + "TokenType.TAG_OPEN_END", + "0:2" + ], + [ + "TokenType.TEXT", + "0:3" + ], + [ + "TokenType.TAG_CLOSE", + "0:4" + ], + [ + "TokenType.EOF", + "0:8" + ] ], "options": null } @@ -37,11 +52,26 @@ "input": "\na", "test_type": "HumanizeLineColumn", "expected": [ - ["TokenType.TAG_OPEN_START", "0:0"], - ["TokenType.TAG_OPEN_END", "0:2"], - ["TokenType.TEXT", "0:3"], - ["TokenType.TAG_CLOSE", "1:1"], - ["TokenType.EOF", "1:5"] + [ + "TokenType.TAG_OPEN_START", + "0:0" + ], + [ + "TokenType.TAG_OPEN_END", + "0:2" + ], + [ + "TokenType.TEXT", + "0:3" + ], + [ + "TokenType.TAG_CLOSE", + "1:1" + ], + [ + "TokenType.EOF", + "1:5" + ] ], "options": null } @@ -56,11 +86,26 @@ "input": "\na", "test_type": "HumanizeLineColumn", "expected": [ - ["TokenType.TAG_OPEN_START", "0:0"], - ["TokenType.TAG_OPEN_END", "1:0"], - ["TokenType.TEXT", "1:1"], - ["TokenType.TAG_CLOSE", "2:1"], - ["TokenType.EOF", "2:5"] + [ + "TokenType.TAG_OPEN_START", + "0:0" + ], + [ + "TokenType.TAG_OPEN_END", + "1:0" + ], + [ + "TokenType.TEXT", + "1:1" + ], + [ + "TokenType.TAG_CLOSE", + "2:1" + ], + [ + "TokenType.EOF", + "2:5" + ] ], "options": null } @@ -75,11 +120,26 @@ "input": "\r\na\r", "test_type": "HumanizeLineColumn", "expected": [ - ["TokenType.TAG_OPEN_START", "0:0"], - ["TokenType.TAG_OPEN_END", "1:0"], - ["TokenType.TEXT", "1:1"], - ["TokenType.TAG_CLOSE", "2:1"], - ["TokenType.EOF", "2:5"] + [ + "TokenType.TAG_OPEN_START", + "0:0" + ], + [ + "TokenType.TAG_OPEN_END", + "1:0" + ], + [ + "TokenType.TEXT", + "1:1" + ], + [ + "TokenType.TAG_CLOSE", + "2:1" + ], + [ + "TokenType.EOF", + "2:5" + ] ], "options": null } @@ -94,18 +154,42 @@ "input": "\n \t a", "test_type": "HumanizeFullStart", "expected": [ - ["TokenType.TAG_OPEN_START", "0:0", "0:0"], - ["TokenType.TAG_OPEN_END", "0:2", "0:2"], - ["TokenType.TEXT", "1:3", "0:3"], - ["TokenType.TAG_CLOSE", "1:4", "1:4"], - ["TokenType.EOF", "1:8", "1:8"] + [ + "TokenType.TAG_OPEN_START", + "0:0", + "0:0" + ], + [ + "TokenType.TAG_OPEN_END", + "0:2", + "0:2" + ], + [ + "TokenType.TEXT", + "1:3", + "0:3" + ], + [ + "TokenType.TAG_CLOSE", + "1:4", + "1:4" + ], + [ + "TokenType.EOF", + "1:8", + "1:8" + ] ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, "escaped_string": false, "tokenize_blocks": null, - "leading_trivia_chars": ["\n", " ", "\t"], + "leading_trivia_chars": [ + "\n", + " ", + "\t" + ], "range": null } } @@ -126,8 +210,14 @@ "input": "pre 1\npre 2\npre 3 `line 1\nline 2\nline 3` post 1\n post 2\n post 3", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TEXT", "line 1\nline 2\nline 3"], - ["TokenType.EOF", ""] + [ + "TokenType.TEXT", + "line 1\nline 2\nline 3" + ], + [ + "TokenType.EOF", + "" + ] ], "options": { "tokenize_expansion_forms": false, @@ -154,8 +244,14 @@ "input": "pre 1\npre 2\npre 3 `line 1\nline 2\nline 3` post 1\n post 2\n post 3", "test_type": "HumanizeLineColumn", "expected": [ - ["TokenType.TEXT", "2:7"], - ["TokenType.EOF", "4:6"] + [ + "TokenType.TEXT", + "2:7" + ], + [ + "TokenType.EOF", + "4:6" + ] ], "options": { "tokenize_expansion_forms": false, @@ -188,10 +284,19 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMMENT_START"], - ["TokenType.RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.COMMENT_END"], - ["TokenType.EOF"] + [ + "TokenType.COMMENT_START" + ], + [ + "TokenType.RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.COMMENT_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -206,10 +311,22 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.COMMENT_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.COMMENT_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -223,7 +340,12 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.COMMENT_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.COMMENT_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -268,10 +407,22 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.COMMENT_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.COMMENT_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -291,7 +442,15 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.DOC_TYPE", "DOCTYPE html"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.DOC_TYPE", + "DOCTYPE html" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -305,8 +464,14 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.DOC_TYPE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.DOC_TYPE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -320,7 +485,154 @@ "type": "HtmlLexerTest", "input": "", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.PROCESSING_INSTRUCTION", + "xml version=\"1.0\" encoding=\"UTF-8\"" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { + "name": "should parse a processing instruction ending with > instead of ?>", + "path": "HtmlLexer/processing instructions/should parse a processing instruction ending with > instead of ?>", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.PROCESSING_INSTRUCTION", + "xml version=\"1.0\" encoding=\"UTF-8\"" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { + "name": "should parse a processing instruction surrounded by other content", + "path": "HtmlLexer/processing instructions/should parse a processing instruction surrounded by other content", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "\n hello", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.DOC_TYPE", + "DOCTYPE html" + ], + [ + "TokenType.TEXT", + "\n" + ], + [ + "TokenType.PROCESSING_INSTRUCTION", + "xml version=\"1.0\" encoding=\"UTF-8\"" + ], + [ + "TokenType.TEXT", + " hello" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { + "name": "should parse a processing instruction that contains question marks inside quoted content", + "path": "HtmlLexer/processing instructions/should parse a processing instruction that contains question marks inside quoted content", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "-8\"?>", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.PROCESSING_INSTRUCTION", + "xml version=\"?\" encoding=\"UTF?>-8\"" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { + "name": "should store the location of a processing instruction", + "path": "HtmlLexer/processing instructions/should store the location of a processing instruction", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "", + "test_type": "HumanizeSourceSpans", + "expected": [ + [ + "TokenType.PROCESSING_INSTRUCTION", + "" + ], + [ + "TokenType.EOF", + "" + ] + ], + "options": null + } + ] + }, + { + "name": "should report missing end of a processing instruction", + "path": "HtmlLexer/processing instructions/should report missing end of a processing instruction", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.CDATA_START"], - ["TokenType.RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.CDATA_END"], - ["TokenType.EOF"] + [ + "TokenType.CDATA_START" + ], + [ + "TokenType.RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.CDATA_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -358,10 +679,22 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.CDATA_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.CDATA_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -375,7 +708,12 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", ""], - ["TokenType.INCOMPLETE_TAG_OPEN", ""], - ["TokenType.EOF", ""] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "" + ], + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -447,19 +814,49 @@ "input": "
    ", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", ""], - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] - ], - "options": null - } + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "" + ], + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] + ], + "options": null + } ] }, { @@ -471,12 +868,30 @@ "input": "
    ", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", ""], - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "" + ], + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -497,11 +912,28 @@ "input": "hello", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "", ""], - ["TokenType.COMPONENT_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.COMPONENT_CLOSE", "MyComp", "", ""], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "", + "" + ], + [ + "TokenType.COMPONENT_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.COMPONENT_CLOSE", + "MyComp", + "", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -516,11 +948,28 @@ "input": "hello", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "", "button"], - ["TokenType.COMPONENT_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.COMPONENT_CLOSE", "MyComp", "", "button"], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "", + "button" + ], + [ + "TokenType.COMPONENT_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.COMPONENT_CLOSE", + "MyComp", + "", + "button" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -535,11 +984,28 @@ "input": "hello", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "svg", "title"], - ["TokenType.COMPONENT_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.COMPONENT_CLOSE", "MyComp", "svg", "title"], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "svg", + "title" + ], + [ + "TokenType.COMPONENT_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.COMPONENT_CLOSE", + "MyComp", + "svg", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -554,9 +1020,18 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "", ""], - ["TokenType.COMPONENT_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "", + "" + ], + [ + "TokenType.COMPONENT_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -571,11 +1046,26 @@ "input": "hello", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.COMPONENT_OPEN_START", ""], - ["TokenType.TEXT", "hello"], - ["TokenType.COMPONENT_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.COMPONENT_OPEN_START", + "" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.COMPONENT_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -590,16 +1080,50 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_COMPONENT_OPEN", "MyComp", "", "span"], - ["TokenType.ATTR_NAME", "", "class"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "hi"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "sty"], - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_COMPONENT_OPEN", + "MyComp", + "", + "span" + ], + [ + "TokenType.ATTR_NAME", + "", + "class" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "hi" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "sty" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -614,11 +1138,28 @@ "input": "t\ne\rs\r\nt", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "", "script"], - ["TokenType.COMPONENT_OPEN_END"], - ["TokenType.RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.COMPONENT_CLOSE", "MyComp", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "", + "script" + ], + [ + "TokenType.COMPONENT_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.COMPONENT_CLOSE", + "MyComp", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -633,11 +1174,28 @@ "input": "t\ne\rs\r\nt", "test_type": "HumanizeParts", "expected": [ - ["TokenType.COMPONENT_OPEN_START", "MyComp", "", "title"], - ["TokenType.COMPONENT_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.COMPONENT_CLOSE", "MyComp", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.COMPONENT_OPEN_START", + "MyComp", + "", + "title" + ], + [ + "TokenType.COMPONENT_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.COMPONENT_CLOSE", + "MyComp", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -658,11 +1216,26 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.DIRECTIVE_NAME", "MyDir"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.DIRECTIVE_NAME", + "MyDir" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -677,13 +1250,32 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.DIRECTIVE_NAME", "MyDir"], - ["TokenType.DIRECTIVE_OPEN"], - ["TokenType.DIRECTIVE_CLOSE"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.DIRECTIVE_NAME", + "MyDir" + ], + [ + "TokenType.DIRECTIVE_OPEN" + ], + [ + "TokenType.DIRECTIVE_CLOSE" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -698,14 +1290,37 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.DIRECTIVE_NAME", "MyDir"], - ["TokenType.DIRECTIVE_OPEN"], - ["TokenType.ATTR_NAME", "", "foo"], - ["TokenType.DIRECTIVE_CLOSE"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.DIRECTIVE_NAME", + "MyDir" + ], + [ + "TokenType.DIRECTIVE_OPEN" + ], + [ + "TokenType.ATTR_NAME", + "", + "foo" + ], + [ + "TokenType.DIRECTIVE_CLOSE" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -730,11 +1345,26 @@ "input": "
    @MyDir()
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "@MyDir()"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "@MyDir()" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -749,14 +1379,39 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.ATTR_NAME", "", "hello"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "@MyDir"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.ATTR_NAME", + "", + "hello" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "@MyDir" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -787,11 +1442,26 @@ "input": "t\ne\rs\r\nt", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -806,13 +1476,35 @@ "input": "&", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", ""], - ["TokenType.ENCODED_ENTITY", "&", "&"], - ["TokenType.ESCAPABLE_RAW_TEXT", ""], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "" + ], + [ + "TokenType.ENCODED_ENTITY", + "&", + "&" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -827,11 +1519,26 @@ "input": "a<div>", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "a
    "], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a
    " + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -846,11 +1553,26 @@ "input": "a</test>", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -865,11 +1587,26 @@ "input": "a", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.ESCAPABLE_RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -890,11 +1627,26 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "svg", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "test"], - ["TokenType.TAG_CLOSE", "svg", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "svg", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "test" + ], + [ + "TokenType.TAG_CLOSE", + "svg", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -909,14 +1661,39 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "svg", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "f"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "test"], - ["TokenType.TAG_CLOSE", "", "f"], - ["TokenType.TAG_CLOSE", "svg", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "svg", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "f" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "test" + ], + [ + "TokenType.TAG_CLOSE", + "", + "f" + ], + [ + "TokenType.TAG_CLOSE", + "svg", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -986,23 +1763,65 @@ "input": "{one.two, three, =4 {four} =5 {five} foo {bar} }", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_CASE_VALUE", "=5"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "five"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_CASE_VALUE", "foo"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "bar"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=5" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "five" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "foo" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "bar" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1024,17 +1843,45 @@ "input": "before{one.two, three, =4 {four}}after", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "before"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", "after"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "before" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + "after" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1056,21 +1903,63 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.RAW_TEXT", "b"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "c"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.RAW_TEXT", + "b" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "c" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1092,23 +1981,71 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", " "], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.RAW_TEXT", "b"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "c"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", " "], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.RAW_TEXT", + "b" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "c" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1130,19 +2067,54 @@ "input": "{one.two, three, =4 {four a}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four "], - ["TokenType.TAG_OPEN_START", "", "b"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "a"], - ["TokenType.TAG_CLOSE", "", "b"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four " + ], + [ + "TokenType.TAG_OPEN_START", + "", + "b" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "", + "b" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1164,17 +2136,47 @@ "input": "{one.two, three, =4 {four {{a}}}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four "], - ["TokenType.INTERPOLATION", "{{", "a", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four " + ], + [ + "TokenType.INTERPOLATION", + "{{", + "a", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -1196,32 +2198,74 @@ "input": "{one.two, three, =4 { {xx, yy, =x {one}} }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "xx"], - ["TokenType.RAW_TEXT", "yy"], - ["TokenType.EXPANSION_CASE_VALUE", "=x"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "one"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", " "], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] - ], - "options": { - "tokenize_expansion_forms": true, - "interpolation_config": null, - "escaped_string": false, - "tokenize_blocks": null, - "leading_trivia_chars": null, - "range": null - } + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "xx" + ], + [ + "TokenType.RAW_TEXT", + "yy" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=x" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "one" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] + ], + "options": { + "tokenize_expansion_forms": true, + "interpolation_config": null, + "escaped_string": false, + "tokenize_blocks": null, + "leading_trivia_chars": null, + "range": null + } } ] } @@ -1301,11 +2345,26 @@ "input": "

    İ

    ", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.TEXT", "İ"], - ["TokenType.TAG_CLOSE", "

    "], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.TEXT", + "İ" + ], + [ + "TokenType.TAG_CLOSE", + "

    " + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -1325,7 +2384,15 @@ "type": "HtmlLexerTest", "input": "\\' \\' \\'", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "' ' '"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "' ' '" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1339,7 +2406,15 @@ "type": "HtmlLexerTest", "input": "\\\" \\\" \\\"", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\" \" \""], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\" \" \"" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1353,7 +2428,15 @@ "type": "HtmlLexerTest", "input": "\\` \\` \\`", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "` ` `"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "` ` `" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1367,7 +2450,15 @@ "type": "HtmlLexerTest", "input": "\\\\ \\\\ \\\\", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\\ \\ \\"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\\ \\ \\" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1381,7 +2472,15 @@ "type": "HtmlLexerTest", "input": "\\n \\n \\n", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\n \n \n"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\n \n \n" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1396,10 +2495,23 @@ "input": "\\r{{\\r}}\\r", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "\n"], - ["TokenType.INTERPOLATION", "{{", "\n", "}}"], - ["TokenType.TEXT", "\n"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "\n" + ], + [ + "TokenType.INTERPOLATION", + "{{", + "\n", + "}}" + ], + [ + "TokenType.TEXT", + "\n" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1414,7 +2526,15 @@ "type": "HtmlLexerTest", "input": "\\v \\v \\v", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u000b \u000b \u000b"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u000b \u000b \u000b" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1428,7 +2548,15 @@ "type": "HtmlLexerTest", "input": "\\t \\t \\t", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\t \t \t"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\t \t \t" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1442,7 +2570,15 @@ "type": "HtmlLexerTest", "input": "\\b \\b \\b", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\b \b \b"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\b \b \b" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1456,7 +2592,15 @@ "type": "HtmlLexerTest", "input": "\\f \\f \\f", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\f \f \f"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\f \f \f" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1471,8 +2615,13 @@ "input": "\\' \\\" \\` \\\\ \\n \\r \\v \\t \\b \\f", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "' \" ` \\ \n \n \u000b \t \b \f"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "' \" ` \\ \n \n \u000b \t \b \f" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1493,7 +2642,11 @@ "type": "HtmlLexerTest", "input": "\\0", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1507,7 +2660,11 @@ "type": "HtmlLexerTest", "input": "\\09", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1528,8 +2685,13 @@ "input": "\\001 \\01 \\1 \\12 \\223 \\19 \\2234 \\999", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "\u0001 \u0001 \u0001 \n “ \u00019 “4 999"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "\u0001 \u0001 \u0001 \n “ \u00019 “4 999" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1550,7 +2712,15 @@ "type": "HtmlLexerTest", "input": "\\x12 \\x4F \\xDC", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u0012 O Ü"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u0012 O Ü" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1570,7 +2740,12 @@ "type": "HtmlLexerTest", "input": "\\xGG", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:2"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:2" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1584,7 +2759,12 @@ "type": "HtmlLexerTest", "input": "abc \\x xyz", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:6"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:6" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1598,7 +2778,12 @@ "type": "HtmlLexerTest", "input": "abc\\x", "test_type": "HumanizeErrors", - "expected": [["Unexpected character \"EOF\"", "0:5"]], + "expected": [ + [ + "Unexpected character \"EOF\"", + "0:5" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1618,7 +2803,15 @@ "type": "HtmlLexerTest", "input": "\\u0123 \\uABCD", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "ģ ꯍ"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "ģ ꯍ" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1638,7 +2831,12 @@ "type": "HtmlLexerTest", "input": "\\uGGGG", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:2"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:2" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1658,7 +2856,15 @@ "type": "HtmlLexerTest", "input": "\\u{01} \\u{ABC} \\u{1234} \\u{123AB}", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u0001 ઼ ሴ 𒎫"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u0001 ઼ ሴ 𒎫" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1678,7 +2884,12 @@ "type": "HtmlLexerTest", "input": "\\u{GG}", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:3"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:3" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1698,7 +2909,15 @@ "type": "HtmlLexerTest", "input": "abc\\\ndef", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "abcdef"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "abcdef" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1712,7 +2931,15 @@ "type": "HtmlLexerTest", "input": "\\\nx\\\ny\\\n", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "xy"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "xy" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1732,7 +2959,15 @@ "type": "HtmlLexerTest", "input": "a g ~", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "a g ~"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "a g ~" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1753,8 +2988,13 @@ "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "abc\ndef\nghi\tjkl`'\"mno"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1776,11 +3016,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1802,11 +3057,26 @@ "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1828,17 +3098,51 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "c"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", "d"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "c" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "d" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -1899,9 +3203,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "test"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "test" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -1916,9 +3228,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "ns1", "test"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "ns1", + "test" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -1933,9 +3253,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "test"], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "test" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -1950,9 +3278,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "test"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "test" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -1967,9 +3303,18 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -1990,10 +3335,20 @@ "input": "@let foo = 123 + 456;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "123 + 456"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123 + 456" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2097,10 +3452,20 @@ "input": "@let foo = \n123 + \n 456 + \n789\n;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "123 + \n 456 + \n789\n"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123 + \n 456 + \n789\n" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2115,13 +3480,30 @@ "input": "@defer {@let foo = 123 + 456;}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "defer"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "123 + 456"], - ["TokenType.LET_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "defer" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123 + 456" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2136,10 +3518,20 @@ "input": "@let foo = 'a; b';", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "'a; b'"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "'a; b'" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2148,10 +3540,20 @@ "input": "@let foo = \"';'\";", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "\"';'\""], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "\"';'\"" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2176,22 +3578,42 @@ "input": "@let foo = [1, 2, 3];", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "[1, 2, 3]"], - ["TokenType.LET_END"], - ["TokenType.EOF"] - ], - "options": null - }, - { - "type": "HtmlLexerTest", - "input": "@let foo = [0, [foo[1]], 3];", + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "[1, 2, 3]" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + }, + { + "type": "HtmlLexerTest", + "input": "@let foo = [0, [foo[1]], 3];", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "[0, [foo[1]], 3]"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "[0, [foo[1]], 3]" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2206,10 +3628,20 @@ "input": "@let foo = {a: 1, b: {c: something + 2}};", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "{a: 1, b: {c: something + 2}}"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "{a: 1, b: {c: something + 2}}" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2218,10 +3650,20 @@ "input": "@let foo = {};", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "{}"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "{}" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2230,10 +3672,20 @@ "input": "@let foo = {foo: \";\"};", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "{foo: \";\"}"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "{foo: \";\"}" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2252,7 +3704,12 @@ "type": "HtmlLexerTest", "input": "@let foo = \";", "test_type": "HumanizeErrors", - "expected": [["Unexpected character \"EOF\"", "0:13"]], + "expected": [ + [ + "Unexpected character \"EOF\"", + "0:13" + ] + ], "options": null }, { @@ -2260,10 +3717,20 @@ "input": "@let foo = {a: 1,;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "{a: 1,"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "{a: 1," + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2272,10 +3739,20 @@ "input": "@let foo = [1, ;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "[1, "], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "[1, " + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2284,10 +3761,20 @@ "input": "@let foo = fn(;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", "fn("], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "fn(" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2302,10 +3789,20 @@ "input": "@let foo =;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "foo"], - ["TokenType.LET_VALUE", ""], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "foo" + ], + [ + "TokenType.LET_VALUE", + "" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2320,9 +3817,17 @@ "input": "@letFoo = 123;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "@let"], - ["TokenType.TEXT", "Foo = 123;"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "@let" + ], + [ + "TokenType.TEXT", + "Foo = 123;" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2337,9 +3842,17 @@ "input": "@let foo\\bar = 123;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "foo"], - ["TokenType.TEXT", "\\bar = 123;"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "foo" + ], + [ + "TokenType.TEXT", + "\\bar = 123;" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2348,9 +3861,17 @@ "input": "@let #foo = 123;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", ""], - ["TokenType.TEXT", "#foo = 123;"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "" + ], + [ + "TokenType.TEXT", + "#foo = 123;" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2359,9 +3880,17 @@ "input": "@let foo\nbar = 123;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "foo"], - ["TokenType.TEXT", "bar = 123;"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "foo" + ], + [ + "TokenType.TEXT", + "bar = 123;" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2376,10 +3905,20 @@ "input": "@let a123 = foo;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.LET_START", "a123"], - ["TokenType.LET_VALUE", "foo"], - ["TokenType.LET_END"], - ["TokenType.EOF"] + [ + "TokenType.LET_START", + "a123" + ], + [ + "TokenType.LET_VALUE", + "foo" + ], + [ + "TokenType.LET_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2388,9 +3927,17 @@ "input": "@let 123a = 123;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", ""], - ["TokenType.TEXT", "123a = 123;"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "" + ], + [ + "TokenType.TEXT", + "123a = 123;" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2405,9 +3952,17 @@ "input": "@let foo = 123 + 456", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "foo"], - ["TokenType.LET_VALUE", "123 + 456"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123 + 456" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2416,9 +3971,17 @@ "input": "@let foo = 123 + 456 ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "foo"], - ["TokenType.LET_VALUE", "123 + 456 "], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123 + 456 " + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2427,9 +3990,17 @@ "input": "@let foo = 123, bar = 456", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_LET", "foo"], - ["TokenType.LET_VALUE", "123, bar = 456"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_LET", + "foo" + ], + [ + "TokenType.LET_VALUE", + "123, bar = 456" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2444,10 +4015,23 @@ "input": "{{ @let foo = 123; }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " @let foo = 123; ", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " @let foo = 123; ", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2468,10 +4052,22 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2486,27 +4082,98 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "v", "}}"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "s"], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "m", "}}"], - ["TokenType.ATTR_VALUE_TEXT", "e"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "c"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "s"], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "m//c", "}}"], - ["TokenType.ATTR_VALUE_TEXT", "e"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + "v", + "}}" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "s" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + "m", + "}}" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "e" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "c" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "s" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + "m//c", + "}}" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "e" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2521,15 +4188,43 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", " a \\\" ' b "], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + " a \\\" ' b " + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2538,15 +4233,43 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", " a \" \\' b "], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + " a \" \\' b " + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2561,10 +4284,22 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "ns1", "a"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "ns1", + "a" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2579,16 +4314,28 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "(ns1:a)"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] - ], - "options": null - } - ] - }, - { + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "(ns1:a)" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { "name": "should parse attributes with single quote value", "path": "HtmlLexer/attributes/should parse attributes with single quote value", "assertions": [ @@ -2597,13 +4344,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2618,13 +4386,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2639,11 +4428,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2658,13 +4462,36 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "a"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "link.text", "}}"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "a" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_VALUE_INTERPOLATION", + "{{", + "link.text", + "}}" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2679,16 +4506,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "app-component"], - ["TokenType.ATTR_NAME", "", "[attr]"], - ["TokenType.ATTR_QUOTE", "\""], + [ + "TokenType.TAG_OPEN_START", + "", + "app-component" + ], + [ + "TokenType.ATTR_NAME", + "", + "[attr]" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], [ "TokenType.ATTR_VALUE_TEXT", "[\n {text: 'some text',url:'//www.google.com'},\n {text:'other text',url:'//www.google.com'}]" ], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2703,13 +4548,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2724,11 +4590,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2743,17 +4624,52 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ENCODED_ENTITY", "A", "A"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ENCODED_ENTITY", "A", "A"], - ["TokenType.ATTR_VALUE_TEXT", ""], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ENCODED_ENTITY", + "A", + "A" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ENCODED_ENTITY", + "A", + "A" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2768,17 +4684,51 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "&"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "c&&d"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "&" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "c&&d" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2793,13 +4743,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "b && c &"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b && c &" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2814,13 +4785,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", "t\ne\ns\nt"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2835,11 +4827,26 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -2853,7 +4860,12 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.data-[size='large']:p-8]"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "expr"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.data-[size='large']:p-8]" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "expr" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2925,10 +5005,22 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.data-[size='large']:p-8]"], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.data-[size='large']:p-8]" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2937,13 +5029,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.data-[size='hello white space']]"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "expr"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.data-[size='hello white space']]" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "expr" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2958,13 +5071,34 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.a]b]c]"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "expr"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.a]b]c]" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "expr" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -2973,10 +5107,22 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.a[]][[]]b]][c]"], - ["TokenType.TAG_OPEN_END_VOID"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.a[]][[]]b]][c]" + ], + [ + "TokenType.TAG_OPEN_END_VOID" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2991,11 +5137,28 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", "", "foo"], - ["TokenType.ATTR_NAME", "", "[class.text-"], - ["TokenType.ATTR_NAME", "", "primary"], - ["TokenType.TEXT", "80]=\"expr\"/>"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "", + "foo" + ], + [ + "TokenType.ATTR_NAME", + "", + "[class.text-" + ], + [ + "TokenType.ATTR_NAME", + "", + "primary" + ], + [ + "TokenType.TEXT", + "80]=\"expr\"/>" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3015,7 +5178,16 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TAG_CLOSE", + "", + "test" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3028,7 +5200,16 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.TAG_CLOSE", "ns1", "test"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TAG_CLOSE", + "ns1", + "test" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3041,7 +5222,16 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TAG_CLOSE", + "", + "test" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3055,8 +5245,14 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -3070,7 +5266,12 @@ "type": "HtmlLexerTest", "input": "a", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.TEXT", "a"], - ["TokenType.INCOMPLETE_TAG_OPEN", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.TEXT", + "a" + ], + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null }, @@ -3516,7 +6013,15 @@ "type": "HtmlLexerTest", "input": "< a>", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "< a>"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "< a>" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3530,17 +6035,50 @@ "input": "{{ a d }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " a "], - ["TokenType.TEXT", ""], - ["TokenType.TAG_OPEN_START", "", "b"], - ["TokenType.ATTR_NAME", "", "&&"], - ["TokenType.ATTR_NAME", "", "c"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", " d "], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " a " + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "b" + ], + [ + "TokenType.ATTR_NAME", + "", + "&&" + ], + [ + "TokenType.ATTR_NAME", + "", + "c" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + " d " + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3555,14 +6093,35 @@ "input": "{{ a }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " a }"], - ["TokenType.TEXT", ""], - ["TokenType.COMMENT_START"], - ["TokenType.RAW_TEXT", ""], - ["TokenType.COMMENT_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " a }" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.COMMENT_START" + ], + [ + "TokenType.RAW_TEXT", + "" + ], + [ + "TokenType.COMMENT_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3577,13 +6136,35 @@ "input": "

    {{ a

    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "p"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " a "], - ["TokenType.TEXT", ""], - ["TokenType.TAG_CLOSE", "", "p"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "p" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " a " + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.TAG_CLOSE", + "", + "p" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3598,14 +6179,35 @@ "input": "{{ a }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " a }"], - ["TokenType.TEXT", ""], - ["TokenType.CDATA_START"], - ["TokenType.RAW_TEXT", ""], - ["TokenType.CDATA_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " a }" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.CDATA_START" + ], + [ + "TokenType.RAW_TEXT", + "" + ], + [ + "TokenType.CDATA_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3620,13 +6222,36 @@ "input": "{{'<={'}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "code"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", "'<={'", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.TAG_CLOSE", "", "code"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "code" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + "'<={'", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.TAG_CLOSE", + "", + "code" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -3648,9 +6273,18 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], - ["TokenType.TEXT", "\">"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "", + "t" + ], + [ + "TokenType.TEXT", + "\">" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -3659,9 +6293,18 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], - ["TokenType.TEXT", "'>"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "", + "t" + ], + [ + "TokenType.TEXT", + "'>" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3676,13 +6319,35 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TEXT", "\">"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TEXT", + "\">" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -3691,13 +6356,35 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TEXT", "'>"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_TAG_OPEN", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TEXT", + "'>" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3712,10 +6399,23 @@ "input": "{{ \"{\" }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " \"{\" ", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " \"{\" ", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3730,10 +6430,23 @@ "input": "{{ \"{{\" }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " \"{{\" ", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " \"{{\" ", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3748,10 +6461,22 @@ "input": "{{ \"{{a}}' }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " \"{{a}}' }}"], - ["TokenType.TEXT", ""], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " \"{{a}}' }}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3766,11 +6491,26 @@ "input": "{a, b, =4 {c}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "{a, b, =4 {c}}"], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "{a, b, =4 {c}}" + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -3798,11 +6538,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3817,11 +6572,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "&"], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "&" + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3836,11 +6606,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "a
    "], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "a
    " + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3855,11 +6640,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3874,11 +6674,26 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -3899,11 +6714,26 @@ "input": "t\ne\rs\r\nt", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "t\ne\ns\nt"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "t\ne\ns\nt" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3918,13 +6748,35 @@ "input": "&", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", ""], - ["TokenType.ENCODED_ENTITY", "&", "&"], - ["TokenType.ESCAPABLE_RAW_TEXT", ""], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "" + ], + [ + "TokenType.ENCODED_ENTITY", + "&", + "&" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3939,11 +6791,26 @@ "input": "a<div>", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "a
    "], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a
    " + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3958,11 +6825,26 @@ "input": "a</test>", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3977,11 +6859,26 @@ "input": "a", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.ESCAPABLE_RAW_TEXT", "a"], - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -4002,11 +6899,26 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "svg", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "test"], - ["TokenType.TAG_CLOSE", "svg", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "svg", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "test" + ], + [ + "TokenType.TAG_CLOSE", + "svg", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -4021,14 +6933,39 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "svg", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "f"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "test"], - ["TokenType.TAG_CLOSE", "", "f"], - ["TokenType.TAG_CLOSE", "svg", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "svg", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "f" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "test" + ], + [ + "TokenType.TAG_CLOSE", + "", + "f" + ], + [ + "TokenType.TAG_CLOSE", + "svg", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -4098,23 +7035,65 @@ "input": "{one.two, three, =4 {four} =5 {five} foo {bar} }", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_CASE_VALUE", "=5"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "five"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_CASE_VALUE", "foo"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "bar"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=5" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "five" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "foo" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "bar" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4136,17 +7115,45 @@ "input": "before{one.two, three, =4 {four}}after", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "before"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", "after"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "before" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + "after" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4168,21 +7175,63 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.RAW_TEXT", "b"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "c"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.RAW_TEXT", + "b" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "c" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4204,23 +7253,71 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "span"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", " "], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "a"], - ["TokenType.RAW_TEXT", "b"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "c"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", " "], - ["TokenType.TAG_CLOSE", "", "span"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "span" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "a" + ], + [ + "TokenType.RAW_TEXT", + "b" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "c" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.TAG_CLOSE", + "", + "span" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4242,19 +7339,54 @@ "input": "{one.two, three, =4 {four a}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four "], - ["TokenType.TAG_OPEN_START", "", "b"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "a"], - ["TokenType.TAG_CLOSE", "", "b"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four " + ], + [ + "TokenType.TAG_OPEN_START", + "", + "b" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "a" + ], + [ + "TokenType.TAG_CLOSE", + "", + "b" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4276,17 +7408,47 @@ "input": "{one.two, three, =4 {four {{a}}}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "four "], - ["TokenType.INTERPOLATION", "{{", "a", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "four " + ], + [ + "TokenType.INTERPOLATION", + "{{", + "a", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4308,23 +7470,65 @@ "input": "{one.two, three, =4 { {xx, yy, =x {one}} }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "one.two"], - ["TokenType.RAW_TEXT", "three"], - ["TokenType.EXPANSION_CASE_VALUE", "=4"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.EXPANSION_FORM_START"], - ["TokenType.RAW_TEXT", "xx"], - ["TokenType.RAW_TEXT", "yy"], - ["TokenType.EXPANSION_CASE_VALUE", "=x"], - ["TokenType.EXPANSION_CASE_EXP_START"], - ["TokenType.TEXT", "one"], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.TEXT", " "], - ["TokenType.EXPANSION_CASE_EXP_END"], - ["TokenType.EXPANSION_FORM_END"], - ["TokenType.EOF"] + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "one.two" + ], + [ + "TokenType.RAW_TEXT", + "three" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=4" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.EXPANSION_FORM_START" + ], + [ + "TokenType.RAW_TEXT", + "xx" + ], + [ + "TokenType.RAW_TEXT", + "yy" + ], + [ + "TokenType.EXPANSION_CASE_VALUE", + "=x" + ], + [ + "TokenType.EXPANSION_CASE_EXP_START" + ], + [ + "TokenType.TEXT", + "one" + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.TEXT", + " " + ], + [ + "TokenType.EXPANSION_CASE_EXP_END" + ], + [ + "TokenType.EXPANSION_FORM_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": true, @@ -4413,11 +7617,26 @@ "input": "

    İ

    ", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.TEXT", "İ"], - ["TokenType.TAG_CLOSE", "

    "], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.TEXT", + "İ" + ], + [ + "TokenType.TAG_CLOSE", + "

    " + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -4437,7 +7656,15 @@ "type": "HtmlLexerTest", "input": "\\' \\' \\'", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "' ' '"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "' ' '" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4451,7 +7678,15 @@ "type": "HtmlLexerTest", "input": "\\\" \\\" \\\"", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\" \" \""], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\" \" \"" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4465,7 +7700,15 @@ "type": "HtmlLexerTest", "input": "\\` \\` \\`", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "` ` `"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "` ` `" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4479,7 +7722,15 @@ "type": "HtmlLexerTest", "input": "\\\\ \\\\ \\\\", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\\ \\ \\"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\\ \\ \\" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4493,7 +7744,15 @@ "type": "HtmlLexerTest", "input": "\\n \\n \\n", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\n \n \n"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\n \n \n" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4508,10 +7767,23 @@ "input": "\\r{{\\r}}\\r", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "\n"], - ["TokenType.INTERPOLATION", "{{", "\n", "}}"], - ["TokenType.TEXT", "\n"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "\n" + ], + [ + "TokenType.INTERPOLATION", + "{{", + "\n", + "}}" + ], + [ + "TokenType.TEXT", + "\n" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -4526,7 +7798,15 @@ "type": "HtmlLexerTest", "input": "\\v \\v \\v", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u000b \u000b \u000b"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u000b \u000b \u000b" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4540,7 +7820,15 @@ "type": "HtmlLexerTest", "input": "\\t \\t \\t", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\t \t \t"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\t \t \t" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4554,7 +7842,15 @@ "type": "HtmlLexerTest", "input": "\\b \\b \\b", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\b \b \b"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\b \b \b" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4568,7 +7864,15 @@ "type": "HtmlLexerTest", "input": "\\f \\f \\f", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\f \f \f"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\f \f \f" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4583,8 +7887,13 @@ "input": "\\' \\\" \\` \\\\ \\n \\r \\v \\t \\b \\f", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "' \" ` \\ \n \n \u000b \t \b \f"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "' \" ` \\ \n \n \u000b \t \b \f" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -4605,7 +7914,11 @@ "type": "HtmlLexerTest", "input": "\\0", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4619,7 +7932,11 @@ "type": "HtmlLexerTest", "input": "\\09", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4640,8 +7957,13 @@ "input": "\\001 \\01 \\1 \\12 \\223 \\19 \\2234 \\999", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "\u0001 \u0001 \u0001 \n “ \u00019 “4 999"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "\u0001 \u0001 \u0001 \n “ \u00019 “4 999" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -4662,7 +7984,15 @@ "type": "HtmlLexerTest", "input": "\\x12 \\x4F \\xDC", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u0012 O Ü"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u0012 O Ü" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4682,7 +8012,12 @@ "type": "HtmlLexerTest", "input": "\\xGG", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:2"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:2" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4696,7 +8031,12 @@ "type": "HtmlLexerTest", "input": "abc \\x xyz", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:6"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:6" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4710,7 +8050,12 @@ "type": "HtmlLexerTest", "input": "abc\\x", "test_type": "HumanizeErrors", - "expected": [["Unexpected character \"EOF\"", "0:5"]], + "expected": [ + [ + "Unexpected character \"EOF\"", + "0:5" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4730,7 +8075,15 @@ "type": "HtmlLexerTest", "input": "\\u0123 \\uABCD", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "ģ ꯍ"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "ģ ꯍ" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4750,7 +8103,12 @@ "type": "HtmlLexerTest", "input": "\\uGGGG", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:2"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:2" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4770,7 +8128,15 @@ "type": "HtmlLexerTest", "input": "\\u{01} \\u{ABC} \\u{1234} \\u{123AB}", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "\u0001 ઼ ሴ 𒎫"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "\u0001 ઼ ሴ 𒎫" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4790,7 +8156,12 @@ "type": "HtmlLexerTest", "input": "\\u{GG}", "test_type": "HumanizeErrors", - "expected": [["Invalid hexadecimal escape sequence", "0:3"]], + "expected": [ + [ + "Invalid hexadecimal escape sequence", + "0:3" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4810,7 +8181,15 @@ "type": "HtmlLexerTest", "input": "abc\\\ndef", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "abcdef"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "abcdef" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4824,7 +8203,15 @@ "type": "HtmlLexerTest", "input": "\\\nx\\\ny\\\n", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "xy"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "xy" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4844,7 +8231,15 @@ "type": "HtmlLexerTest", "input": "a g ~", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "a g ~"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "a g ~" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4864,7 +8259,15 @@ "type": "HtmlLexerTest", "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "abc\ndef\nghi\tjkl`'\"mno"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4885,11 +8288,26 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "script"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], - ["TokenType.TAG_CLOSE", "", "script"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "script" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.RAW_TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.TAG_CLOSE", + "", + "script" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -4911,11 +8329,26 @@ "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "title"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.ESCAPABLE_RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], - ["TokenType.TAG_CLOSE", "", "title"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "title" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.ESCAPABLE_RAW_TEXT", + "abc\ndef\nghi\tjkl`'\"mno" + ], + [ + "TokenType.TAG_CLOSE", + "", + "title" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -4937,17 +8370,51 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "t"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "c"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.ATTR_VALUE_TEXT", "d"], - ["TokenType.ATTR_QUOTE", "'"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "c" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "d" + ], + [ + "TokenType.ATTR_QUOTE", + "'" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": { "tokenize_expansion_forms": false, @@ -5037,10 +8504,40 @@ "input": "@default never;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "default never"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "default never" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + }, + { + "type": "HtmlLexerTest", + "input": "@default never;", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.BLOCK_OPEN_START", + "default never" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5055,11 +8552,23 @@ "input": "@default never(expr);", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "default never"], - ["TokenType.BLOCK_PARAMETER", "expr"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "default never" + ], + [ + "TokenType.BLOCK_PARAMETER", + "expr" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5074,10 +8583,19 @@ "input": "@default never ;", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "default never"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "default never" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5092,13 +8610,31 @@ "input": "@for (item of items; track item.id) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "for"], - ["TokenType.BLOCK_PARAMETER", "item of items"], - ["TokenType.BLOCK_PARAMETER", "track item.id"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "for" + ], + [ + "TokenType.BLOCK_PARAMETER", + "item of items" + ], + [ + "TokenType.BLOCK_PARAMETER", + "track item.id" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5113,12 +8649,27 @@ "input": "@for (item of items;) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "for"], - ["TokenType.BLOCK_PARAMETER", "item of items"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "for" + ], + [ + "TokenType.BLOCK_PARAMETER", + "item of items" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5133,11 +8684,23 @@ "input": "@else if {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "else if"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "else if" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null }, @@ -5146,12 +8709,58 @@ "input": "@else if (foo !== 2) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "else if"], - ["TokenType.BLOCK_PARAMETER", "foo !== 2"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "else if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "foo !== 2" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] + ], + "options": null + } + ] + }, + { + "name": "should normalize @else if block name with spaces", + "path": "HtmlLexer/blocks/should normalize @else if block name with spaces", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "@else if {hello}", + "test_type": "HumanizeParts", + "expected": [ + [ + "TokenType.BLOCK_OPEN_START", + "else if" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5200,12 +8809,27 @@ "input": "@for (item of items;;;;;) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "for"], - ["TokenType.BLOCK_PARAMETER", "item of items"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "for" + ], + [ + "TokenType.BLOCK_PARAMETER", + "item of items" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5220,11 +8844,23 @@ "input": "@defer {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "defer"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "defer" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5239,12 +8875,27 @@ "input": "@for (item of items){hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "for"], - ["TokenType.BLOCK_PARAMETER", "item of items"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "for" + ], + [ + "TokenType.BLOCK_PARAMETER", + "item of items" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5264,13 +8915,31 @@ "input": "@defer (on a({a: 1, b: 2}, false, {c: 3}); when b({d: 4})) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "defer"], - ["TokenType.BLOCK_PARAMETER", "on a({a: 1, b: 2}, false, {c: 3})"], - ["TokenType.BLOCK_PARAMETER", "when b({d: 4})"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "defer" + ], + [ + "TokenType.BLOCK_PARAMETER", + "on a({a: 1, b: 2}, false, {c: 3})" + ], + [ + "TokenType.BLOCK_PARAMETER", + "when b({d: 4})" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5285,9 +8954,17 @@ "input": "@if (a === b {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], - ["TokenType.BLOCK_PARAMETER", "a === b {hello}"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "a === b {hello}" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5302,10 +8979,20 @@ "input": "@if a === b) {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_BLOCK_OPEN", "if a"], - ["TokenType.TEXT", "=== b) {hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "if a" + ], + [ + "TokenType.TEXT", + "=== b) {hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5319,14 +9006,24 @@ "type": "HtmlLexerTest", "input": "@if (a === \") {hello}", "test_type": "HumanizeErrors", - "expected": [["Unexpected character \"EOF\"", "0:21"]], + "expected": [ + [ + "Unexpected character \"EOF\"", + "0:21" + ] + ], "options": null }, { "type": "HtmlLexerTest", "input": "@if (a === \"hi') {hello}", "test_type": "HumanizeErrors", - "expected": [["Unexpected character \"EOF\"", "0:24"]], + "expected": [ + [ + "Unexpected character \"EOF\"", + "0:24" + ] + ], "options": null } ] @@ -5340,11 +9037,24 @@ "input": "@if ({invalid: true) hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], - ["TokenType.BLOCK_PARAMETER", "{invalid: true"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "{invalid: true" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5359,12 +9069,27 @@ "input": "@if (condition === \"';'\") {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "if"], - ["TokenType.BLOCK_PARAMETER", "condition === \"';'\""], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "condition === \"';'\"" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5379,12 +9104,27 @@ "input": "@if (condition === \"\\\";\") {hello}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "if"], - ["TokenType.BLOCK_PARAMETER", "condition === \"\\\";\""], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "hello"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "condition === \"\\\";\"" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "hello" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5399,17 +9139,48 @@ "input": "@if (a === 1) {foo bar baz}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "if"], - ["TokenType.BLOCK_PARAMETER", "a === 1"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", "foo "], - ["TokenType.TAG_OPEN_START", "", "b"], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TEXT", "bar"], - ["TokenType.TAG_CLOSE", "", "b"], - ["TokenType.TEXT", " baz"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "a === 1" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "foo " + ], + [ + "TokenType.TAG_OPEN_START", + "", + "b" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TEXT", + "bar" + ], + [ + "TokenType.TAG_CLOSE", + "", + "b" + ], + [ + "TokenType.TEXT", + " baz" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5424,22 +9195,70 @@ "input": "@if (a === 1) {
    }", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "if"], - ["TokenType.BLOCK_PARAMETER", "a === 1"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "}"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_NAME", "", "b"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "{"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "a === 1" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "}" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_NAME", + "", + "b" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "{" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5454,14 +9273,39 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TAG_OPEN_START", "", "div"], - ["TokenType.ATTR_NAME", "", "a"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.ATTR_VALUE_TEXT", "@if (foo) {}"], - ["TokenType.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.TAG_CLOSE", "", "div"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_START", + "", + "div" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.ATTR_VALUE_TEXT", + "@if (foo) {}" + ], + [ + "TokenType.ATTR_QUOTE", + "\"" + ], + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.TAG_CLOSE", + "", + "div" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5486,13 +9330,33 @@ "input": "@defer {{{message}}}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.BLOCK_OPEN_START", "defer"], - ["TokenType.BLOCK_OPEN_END"], - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", "message", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.BLOCK_CLOSE"], - ["TokenType.EOF"] + [ + "TokenType.BLOCK_OPEN_START", + "defer" + ], + [ + "TokenType.BLOCK_OPEN_END" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + "message", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.BLOCK_CLOSE" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5507,10 +9371,21 @@ "input": "My email frodo@for.com", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "My email frodo"], - ["TokenType.INCOMPLETE_BLOCK_OPEN", "for"], - ["TokenType.TEXT", ".com"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "My email frodo" + ], + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "for" + ], + [ + "TokenType.TEXT", + ".com" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5525,9 +9400,17 @@ "input": "My favorite console is @switch", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "My favorite console is "], - ["TokenType.INCOMPLETE_BLOCK_OPEN", "switch"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "My favorite console is " + ], + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "switch" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5542,10 +9425,21 @@ "input": "Use the @for() block", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "Use the "], - ["TokenType.INCOMPLETE_BLOCK_OPEN", "for"], - ["TokenType.TEXT", "block"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "Use the " + ], + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "for" + ], + [ + "TokenType.TEXT", + "block" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5560,11 +9454,25 @@ "input": "This is the @if({alias: \"foo\"}) expression", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", "This is the "], - ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], - ["TokenType.BLOCK_PARAMETER", "{alias: \"foo\"}"], - ["TokenType.TEXT", "expression"], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "This is the " + ], + [ + "TokenType.INCOMPLETE_BLOCK_OPEN", + "if" + ], + [ + "TokenType.BLOCK_PARAMETER", + "{alias: \"foo\"}" + ], + [ + "TokenType.TEXT", + "expression" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -5578,7 +9486,15 @@ "type": "HtmlLexerTest", "input": "@", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5591,7 +9507,15 @@ "type": "HtmlLexerTest", "input": " @", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", " @"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + " @" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5604,7 +9528,15 @@ "type": "HtmlLexerTest", "input": "@ ", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@ "], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@ " + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5617,7 +9549,15 @@ "type": "HtmlLexerTest", "input": "@\nfoo", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@\nfoo"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@\nfoo" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5630,7 +9570,15 @@ "type": "HtmlLexerTest", "input": "foo bar @ baz clink", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "foo bar @ baz clink"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "foo bar @ baz clink" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5643,7 +9591,15 @@ "type": "HtmlLexerTest", "input": "@ if", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@ if"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@ if" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] diff --git a/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json b/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json index 4691881136..faa29132f9 100644 --- a/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json +++ b/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json @@ -38,6 +38,133 @@ "name": "does not escape class (but it probably should)", "path": "AbstractEmitter/escapeIdentifier/does not escape class (but it probably should)", "assertions": [] + }, + { + "name": "should escape non-ascii and control characters when escapeNonAscii is true", + "path": "AbstractEmitter/escapeIdentifier/should escape non-ascii and control characters when escapeNonAscii is true", + "assertions": [] + }, + { + "name": "should not escape unquoted legal identifiers when escapeNonAscii is true", + "path": "AbstractEmitter/escapeIdentifier/should not escape unquoted legal identifiers when escapeNonAscii is true", + "assertions": [] + } + ] + }, + { + "name": "visitLiteralMapExpr", + "groups": [], + "tests": [ + { + "name": "should emit leading comments on the first property assignment on its own line", + "path": "AbstractEmitter/visitLiteralMapExpr/should emit leading comments on the first property assignment on its own line", + "assertions": [] + }, + { + "name": "should emit leading comments on subsequent property assignments after the comma", + "path": "AbstractEmitter/visitLiteralMapExpr/should emit leading comments on subsequent property assignments after the comma", + "assertions": [] + }, + { + "name": "should omit leading comments on property assignments when printComments is false", + "path": "AbstractEmitter/visitLiteralMapExpr/should omit leading comments on property assignments when printComments is false", + "assertions": [] + }, + { + "name": "should handle spread assignments alongside commented property assignments", + "path": "AbstractEmitter/visitLiteralMapExpr/should handle spread assignments alongside commented property assignments", + "assertions": [] + } + ] + }, + { + "name": "visitParenthesizedExpr", + "groups": [], + "tests": [ + { + "name": "should parenthesize a double negation before a method call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a double negation before a method call", + "assertions": [] + }, + { + "name": "should parenthesize a negation before a property read", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a negation before a property read", + "assertions": [] + }, + { + "name": "should parenthesize a negation before a keyed read", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a negation before a keyed read", + "assertions": [] + }, + { + "name": "should parenthesize a negation before a call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a negation before a call", + "assertions": [] + }, + { + "name": "should parenthesize a typeof expression before a property read", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a typeof expression before a property read", + "assertions": [] + }, + { + "name": "should parenthesize a void expression before a property read", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a void expression before a property read", + "assertions": [] + }, + { + "name": "should parenthesize a negation on the left side of an exponentiation", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a negation on the left side of an exponentiation", + "assertions": [] + }, + { + "name": "should parenthesize a typeof expression on the left side of an exponentiation", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a typeof expression on the left side of an exponentiation", + "assertions": [] + }, + { + "name": "should parenthesize a number literal before a method call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a number literal before a method call", + "assertions": [] + }, + { + "name": "should parenthesize an arrow function before a property read", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize an arrow function before a property read", + "assertions": [] + }, + { + "name": "should parenthesize an arrow function in a binary expression", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize an arrow function in a binary expression", + "assertions": [] + }, + { + "name": "should parenthesize a call used as the class of an instantiation", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a call used as the class of an instantiation", + "assertions": [] + }, + { + "name": "should not double-parenthesize expressions that parenthesize themselves", + "path": "AbstractEmitter/visitParenthesizedExpr/should not double-parenthesize expressions that parenthesize themselves", + "assertions": [] + }, + { + "name": "should parenthesize a negative number before a method call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a negative number before a method call", + "assertions": [] + }, + { + "name": "should parenthesize a conditional expression before a method call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a conditional expression before a method call", + "assertions": [] + }, + { + "name": "should parenthesize a binary expression before a method call", + "path": "AbstractEmitter/visitParenthesizedExpr/should parenthesize a binary expression before a method call", + "assertions": [] + }, + { + "name": "should not add redundant parentheses around an if statement condition", + "path": "AbstractEmitter/visitParenthesizedExpr/should not add redundant parentheses around an if statement condition", + "assertions": [] } ] } diff --git a/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json b/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json index e55dbaee97..468364526a 100644 --- a/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json @@ -16,7 +16,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [["1 + 2"]], + "expected": [ + [ + "1 + 2" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -33,7 +37,14 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [["1"], ["2"]], + "expected": [ + [ + "1" + ], + [ + "2" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -56,7 +67,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{bool ? 1 : 0}}
    ", - "expected": [["bool ? 1 : 0"]], + "expected": [ + [ + "bool ? 1 : 0" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -73,7 +88,17 @@ { "type": "HumanizeExpressionSource", "input": "
    {{bool ? 1 : 0}}
    ", - "expected": [["bool"], ["1"], ["0"]], + "expected": [ + [ + "bool" + ], + [ + "1" + ], + [ + "0" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -96,7 +121,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["a(); b();"]], + "expected": [ + [ + "a(); b();" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -113,7 +142,14 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["a()"], ["b()"]], + "expected": [ + [ + "a()" + ], + [ + "b()" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -136,7 +172,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{fn()()}}
    ", - "expected": [["fn()()"]], + "expected": [ + [ + "fn()()" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -153,7 +193,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{fn()(param)}}
    ", - "expected": [["param"]], + "expected": [ + [ + "param" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -176,7 +220,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + foo.length}}
    ", - "expected": [["{{ 1 + foo.length }}"]], + "expected": [ + [ + "{{ 1 + foo.length }}" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -193,7 +241,14 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [["1"], ["2"]], + "expected": [ + [ + "1" + ], + [ + "2" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -210,7 +265,11 @@ { "type": "HumanizeExpressionSource", "input": " {{abc}}", - "expected": [["abc"]], + "expected": [ + [ + "abc" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -227,7 +286,17 @@ { "type": "HumanizeExpressionSource", "input": ""{{abc}}"{{def}} {{ghi}}", - "expected": [["abc"], ["def"], ["ghi"]], + "expected": [ + [ + "abc" + ], + [ + "def" + ], + [ + "ghi" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -244,7 +313,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["abc"]], + "expected": [ + [ + "abc" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -261,7 +334,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["abc"]], + "expected": [ + [ + "abc" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -278,7 +355,14 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["abc"], ["def"]], + "expected": [ + [ + "abc" + ], + [ + "def" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -301,7 +385,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key]}}
    ", - "expected": [["obj[key]"]], + "expected": [ + [ + "obj[key]" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -318,7 +406,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key]}}
    ", - "expected": [["key"]], + "expected": [ + [ + "key" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -341,7 +433,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key] = 0}}
    ", - "expected": [["obj[key] = 0"]], + "expected": [ + [ + "obj[key] = 0" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -358,7 +454,14 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key] = 0}}
    ", - "expected": [["key"], ["0"]], + "expected": [ + [ + "key" + ], + [ + "0" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -381,7 +484,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{[0, 1, 2]}}
    ", - "expected": [["[0, 1, 2]"]], + "expected": [ + [ + "[0, 1, 2]" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -398,7 +505,17 @@ { "type": "HumanizeExpressionSource", "input": "
    {{[0, 1, 2]}}
    ", - "expected": [["0"], ["1"], ["2"]], + "expected": [ + [ + "0" + ], + [ + "1" + ], + [ + "2" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -421,7 +538,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{ {a: 0} }}
    ", - "expected": [["{a: 0}"]], + "expected": [ + [ + "{a: 0}" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -438,7 +559,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{ {a: 0} }}
    ", - "expected": [["0"]], + "expected": [ + [ + "0" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -461,7 +586,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{method()}}
    ", - "expected": [["method()"]], + "expected": [ + [ + "method()" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -478,7 +607,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{method(param)}}
    ", - "expected": [["param"]], + "expected": [ + [ + "param" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -501,7 +634,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop!}}
    ", - "expected": [["prop!"]], + "expected": [ + [ + "prop!" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -518,7 +655,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop!}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -541,7 +682,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop | pipe}}
    ", - "expected": [["(prop | pipe)"]], + "expected": [ + [ + "(prop | pipe)" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -558,7 +703,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop | pipe}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -581,7 +730,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop.obj}}
    ", - "expected": [["prop.obj"]], + "expected": [ + [ + "prop.obj" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -598,7 +751,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop.obj}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -621,7 +778,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["prop = 0"]], + "expected": [ + [ + "prop = 0" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -638,7 +799,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["prop.inner = 0"]], + "expected": [ + [ + "prop.inner = 0" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -655,7 +820,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["0"]], + "expected": [ + [ + "0" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -678,7 +847,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{!prop}}
    ", - "expected": [["!prop"]], + "expected": [ + [ + "!prop" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -695,7 +868,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{!prop}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -718,7 +895,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe()}}
    ", - "expected": [["prop?.safe()"]], + "expected": [ + [ + "prop?.safe()" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -735,7 +916,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe()}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -758,7 +943,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe}}
    ", - "expected": [["prop?.safe"]], + "expected": [ + [ + "prop?.safe" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -775,7 +964,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe}}
    ", - "expected": [["prop"]], + "expected": [ + [ + "prop" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -798,7 +991,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{item}}
    ", - "expected": [["items"]], + "expected": [ + [ + "items" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -815,7 +1012,14 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["As"], ["Bs"]], + "expected": [ + [ + "As" + ], + [ + "Bs" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -863,7 +1067,11 @@ { "type": "HumanizeExpressionSource", "input": "{{foo // comment}}", - "expected": [["foo"]], + "expected": [ + [ + "foo" + ] + ], "options": { "preserve_whitespaces": true }, @@ -882,7 +1090,11 @@ { "type": "HumanizeExpressionSource", "input": "{{ foo }}", - "expected": [["foo"]], + "expected": [ + [ + "foo" + ] + ], "options": { "preserve_whitespaces": true }, @@ -901,7 +1113,11 @@ { "type": "HumanizeExpressionSource", "input": "{{ foo // comment }}", - "expected": [["foo"]], + "expected": [ + [ + "foo" + ] + ], "options": { "preserve_whitespaces": true }, @@ -920,7 +1136,11 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [["foo = true"]], + "expected": [ + [ + "foo = true" + ] + ], "options": { "preserve_whitespaces": true }, @@ -939,7 +1159,11 @@ { "type": "HumanizeExpressionSource", "input": "
    \n \n{{foo}}
    ", - "expected": [["\n \n{{ foo }}"]], + "expected": [ + [ + "\n \n{{ foo }}" + ] + ], "options": { "preserve_whitespaces": true }, @@ -958,7 +1182,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{foo}}
    ", - "expected": [["{{ foo }}"]], + "expected": [ + [ + "{{ foo }}" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -975,7 +1203,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["foo(); bar();"]], + "expected": [ + [ + "foo(); bar();" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -986,7 +1218,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["foo(); bar();"]], + "expected": [ + [ + "foo(); bar();" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1003,7 +1239,11 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [["condition ? true : false"]], + "expected": [ + [ + "condition ? true : false" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1014,7 +1254,11 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [["condition ? true : false"]], + "expected": [ + [ + "condition ? true : false" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1031,7 +1275,11 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [["(value | async)"]], + "expected": [ + [ + "(value | async)" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1048,7 +1296,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{a.b}}
    ", - "expected": [[""]], + "expected": [ + [ + "" + ] + ], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": true, @@ -1065,7 +1317,11 @@ { "type": "HumanizeExpressionSource", "input": "
    {{100}}
    ", - "expected": [["100"]], + "expected": [ + [ + "100" + ] + ], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, diff --git a/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json b/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json index 1a84935d18..1ca6054a72 100644 --- a/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json @@ -16,7 +16,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -29,8 +34,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["TextAttribute", "a=\"b\"", "a", "b"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "TextAttribute", + "a=\"b\"", + "a", + "b" + ] ], "ignore_error": false } @@ -44,8 +59,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["TextAttribute", "a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "TextAttribute", + "a", + "a", + "" + ] ], "ignore_error": false } @@ -59,8 +84,18 @@ "type": "ExpectFromHtml", "input": "\n \n", "expected": [ - ["Element", "", "", ""], - ["Element", "\n", "", ""] + [ + "Element", + "", + "", + "" + ], + [ + "Element", + "\n", + "", + "" + ] ], "ignore_error": false } @@ -79,7 +114,12 @@ { "type": "ExpectFromHtml", "input": "{{a}}", - "expected": [["BoundText", "{{a}}"]], + "expected": [ + [ + "BoundText", + "{{a}}" + ] + ], "ignore_error": false } ] @@ -98,8 +138,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "[someProp]=\"v\"", "someProp", "v"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "[someProp]=\"v\"", + "someProp", + "v" + ] ], "ignore_error": false } @@ -113,8 +163,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "[someProp]", "someProp", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "[someProp]", + "someProp", + "" + ] ], "ignore_error": false } @@ -128,8 +188,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "bind-prop=\"v\"", "prop", "v"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "bind-prop=\"v\"", + "prop", + "v" + ] ], "ignore_error": false } @@ -143,8 +213,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "prop=\"{{v}}\"", "prop", "{{v}}"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "prop=\"{{v}}\"", + "prop", + "{{v}}" + ] ], "ignore_error": false } @@ -164,7 +244,12 @@ "
    ", "
    " ], - ["BoundAttribute", "data-prop=\"{{v}}\"", "data-prop", "{{v}}"] + [ + "BoundAttribute", + "data-prop=\"{{v}}\"", + "data-prop", + "{{v}}" + ] ], "ignore_error": false } @@ -184,7 +269,12 @@ "
    ", "
    " ], - ["BoundAttribute", "bind-@animation=\"v\"", "animation", "v"] + [ + "BoundAttribute", + "bind-@animation=\"v\"", + "animation", + "v" + ] ], "ignore_error": false } @@ -204,7 +294,12 @@ "
    ", "
    " ], - ["BoundAttribute", "bind-animate-animationName=\"v\"", "animationName", "v"] + [ + "BoundAttribute", + "bind-animate-animationName=\"v\"", + "animationName", + "v" + ] ], "ignore_error": false } @@ -218,8 +313,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "@animation", "animation", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "@animation", + "animation", + "" + ] ], "ignore_error": false } @@ -249,9 +354,24 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Template", "
    ", "
    ", "
    "], - ["TextAttribute", "ngIf", "ngIf", ""], - ["Element", "
    ", "
    ", "
    "] + [ + "Template", + "
    ", + "
    ", + "
    " + ], + [ + "TextAttribute", + "ngIf", + "ngIf", + "" + ], + [ + "Element", + "
    ", + "
    ", + "
    " + ] ], "ignore_error": false } @@ -265,7 +385,12 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Template", "", "", ""] + [ + "Template", + "", + "", + "" + ] ], "ignore_error": false } @@ -285,7 +410,12 @@ "", "" ], - ["Reference", "#a", "a", ""] + [ + "Reference", + "#a", + "a", + "" + ] ], "ignore_error": false } @@ -305,7 +435,12 @@ "", "" ], - ["Reference", "#a=\"b\"", "a", "b"] + [ + "Reference", + "#a=\"b\"", + "a", + "b" + ] ], "ignore_error": false } @@ -325,7 +460,12 @@ "", "" ], - ["Reference", "ref-a", "a", ""] + [ + "Reference", + "ref-a", + "a", + "" + ] ], "ignore_error": false } @@ -345,7 +485,12 @@ "", "" ], - ["TextAttribute", "data-ref-a", "data-ref-a", ""] + [ + "TextAttribute", + "data-ref-a", + "data-ref-a", + "" + ] ], "ignore_error": false } @@ -365,7 +510,12 @@ "", "" ], - ["Variable", "let-a=\"b\"", "a", "b"] + [ + "Variable", + "let-a=\"b\"", + "a", + "b" + ] ], "ignore_error": false } @@ -385,7 +535,12 @@ "", "" ], - ["TextAttribute", "data-let-a=\"b\"", "data-let-a", "b"] + [ + "TextAttribute", + "data-let-a=\"b\"", + "data-let-a", + "b" + ] ], "ignore_error": false } @@ -405,7 +560,12 @@ "", "" ], - ["TextAttribute", "k1=\"v1\"", "k1", "v1"] + [ + "TextAttribute", + "k1=\"v1\"", + "k1", + "v1" + ] ], "ignore_error": false } @@ -425,7 +585,12 @@ "", "" ], - ["BoundAttribute", "[k1]=\"v1\"", "k1", "v1"] + [ + "BoundAttribute", + "[k1]=\"v1\"", + "k1", + "v1" + ] ], "ignore_error": false } @@ -451,9 +616,24 @@ "
    ", "
    " ], - ["TextAttribute", "ngFor", "ngFor", ""], - ["BoundAttribute", "of items", "of", "items"], - ["Variable", "let item ", "item", ""], + [ + "TextAttribute", + "ngFor", + "ngFor", + "" + ], + [ + "BoundAttribute", + "of items", + "of", + "items" + ], + [ + "Variable", + "let item ", + "item", + "" + ], [ "Element", "
    ", @@ -473,8 +653,18 @@ "
    ", "
    " ], - ["BoundAttribute", "ngFor=\"item ", "ngFor", "item"], - ["BoundAttribute", "of items", "of", "items"], + [ + "BoundAttribute", + "ngFor=\"item ", + "ngFor", + "item" + ], + [ + "BoundAttribute", + "of items", + "of", + "items" + ], [ "Element", "
    ", @@ -494,10 +684,30 @@ "
    ", "
    " ], - ["TextAttribute", "ngFor", "ngFor", ""], - ["BoundAttribute", "of items; ", "of", "items"], - ["BoundAttribute", "trackBy: trackByFn", "trackBy", "trackByFn"], - ["Variable", "let item ", "item", ""], + [ + "TextAttribute", + "ngFor", + "ngFor", + "" + ], + [ + "BoundAttribute", + "of items; ", + "of", + "items" + ], + [ + "BoundAttribute", + "trackBy: trackByFn", + "trackBy", + "trackByFn" + ], + [ + "Variable", + "let item ", + "item", + "" + ], [ "Element", "
    ", @@ -523,8 +733,18 @@ "
    ", "
    " ], - ["TextAttribute", "ngIf", "ngIf", ""], - ["Variable", "let a=b", "a", "b"], + [ + "TextAttribute", + "ngIf", + "ngIf", + "" + ], + [ + "Variable", + "let a=b", + "a", + "b" + ], [ "Element", "
    ", @@ -550,8 +770,18 @@ "
    ", "
    " ], - ["BoundAttribute", "ngIf=\"expr ", "ngIf", "expr"], - ["Variable", "ngIf=\"expr as local", "local", "ngIf"], + [ + "BoundAttribute", + "ngIf=\"expr ", + "ngIf", + "expr" + ], + [ + "Variable", + "ngIf=\"expr as local", + "local", + "ngIf" + ], [ "Element", "
    ", @@ -583,7 +813,12 @@ "
    ", "
    " ], - ["BoundEvent", "(someEvent)=\"v\"", "someEvent", "v"] + [ + "BoundEvent", + "(someEvent)=\"v\"", + "someEvent", + "v" + ] ], "ignore_error": false } @@ -597,8 +832,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundEvent", "on-event=\"v\"", "event", "v"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundEvent", + "on-event=\"v\"", + "event", + "v" + ] ], "ignore_error": false } @@ -618,7 +863,12 @@ "
    ", "
    " ], - ["TextAttribute", "data-on-event=\"v\"", "data-on-event", "v"] + [ + "TextAttribute", + "data-on-event=\"v\"", + "data-on-event", + "v" + ] ], "ignore_error": false } @@ -632,9 +882,24 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["BoundAttribute", "[(prop)]=\"v\"", "prop", "v"], - ["BoundEvent", "[(prop)]=\"v\"", "prop", "v"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "BoundAttribute", + "[(prop)]=\"v\"", + "prop", + "v" + ], + [ + "BoundEvent", + "[(prop)]=\"v\"", + "prop", + "v" + ] ], "ignore_error": false } @@ -654,8 +919,18 @@ "
    ", "
    " ], - ["BoundAttribute", "bindon-prop=\"v\"", "prop", "v"], - ["BoundEvent", "bindon-prop=\"v\"", "prop", "v"] + [ + "BoundAttribute", + "bindon-prop=\"v\"", + "prop", + "v" + ], + [ + "BoundEvent", + "bindon-prop=\"v\"", + "prop", + "v" + ] ], "ignore_error": false } @@ -675,7 +950,12 @@ "
    ", "
    " ], - ["TextAttribute", "data-bindon-prop=\"v\"", "data-bindon-prop", "v"] + [ + "TextAttribute", + "data-bindon-prop=\"v\"", + "data-bindon-prop", + "v" + ] ], "ignore_error": false } @@ -695,7 +975,12 @@ "
    ", "
    " ], - ["BoundEvent", "(@name.done)=\"v\"", "name.done", "v"] + [ + "BoundEvent", + "(@name.done)=\"v\"", + "name.done", + "v" + ] ], "ignore_error": false } @@ -715,8 +1000,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "#a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "#a", + "a", + "" + ] ], "ignore_error": false } @@ -730,8 +1025,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "#a=\"b\"", "a", "b"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "#a=\"b\"", + "a", + "b" + ] ], "ignore_error": false } @@ -745,8 +1050,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "ref-a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "ref-a", + "a", + "" + ] ], "ignore_error": false } @@ -772,9 +1087,18 @@ "", "" ], - ["Icu", "{item.var, plural, other { {{item.placeholder}} items } }"], - ["Icu:Var", "item.var"], - ["Icu:Placeholder", "{{item.placeholder}}"] + [ + "Icu", + "{item.var, plural, other { {{item.placeholder}} items } }" + ], + [ + "Icu:Var", + "item.var" + ], + [ + "Icu:Placeholder", + "{{item.placeholder}}" + ] ], "ignore_error": false } @@ -798,10 +1122,22 @@ "Icu", "{item.var, plural, other { {{item.placeholder}} {nestedVar, plural, other { {{nestedPlaceholder}} }}} }" ], - ["Icu:Var", "nestedVar"], - ["Icu:Var", "item.var"], - ["Icu:Placeholder", "{{item.placeholder}}"], - ["Icu:Placeholder", "{{nestedPlaceholder}}"] + [ + "Icu:Var", + "nestedVar" + ], + [ + "Icu:Var", + "item.var" + ], + [ + "Icu:Placeholder", + "{{item.placeholder}}" + ], + [ + "Icu:Placeholder", + "{{nestedPlaceholder}}" + ] ], "ignore_error": false } @@ -827,41 +1163,96 @@ "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate on interaction; hydrate when isVisible(); hydrate on timer(1200)) {", "}" ], - ["InteractionDeferredTrigger", "hydrate on interaction"], - ["BoundDeferredTrigger", "hydrate when isVisible()"], - ["TimerDeferredTrigger", "hydrate on timer(1200)"], - ["BoundDeferredTrigger", "when isVisible() && foo"], - ["HoverDeferredTrigger", "on hover(button)"], - ["TimerDeferredTrigger", "timer(10s)"], - ["IdleDeferredTrigger", "idle"], - ["ImmediateDeferredTrigger", "immediate"], - ["InteractionDeferredTrigger", "interaction(button)"], - ["ViewportDeferredTrigger", "viewport(container)"], - ["ImmediateDeferredTrigger", "prefetch on immediate"], - ["BoundDeferredTrigger", "prefetch when isDataLoaded()"], + [ + "InteractionDeferredTrigger", + "hydrate on interaction" + ], + [ + "BoundDeferredTrigger", + "hydrate when isVisible()" + ], + [ + "TimerDeferredTrigger", + "hydrate on timer(1200)" + ], + [ + "BoundDeferredTrigger", + "when isVisible() && foo" + ], + [ + "HoverDeferredTrigger", + "on hover(button)" + ], + [ + "TimerDeferredTrigger", + "timer(10s)" + ], + [ + "IdleDeferredTrigger", + "idle" + ], + [ + "ImmediateDeferredTrigger", + "immediate" + ], + [ + "InteractionDeferredTrigger", + "interaction(button)" + ], + [ + "ViewportDeferredTrigger", + "viewport(container)" + ], + [ + "ImmediateDeferredTrigger", + "prefetch on immediate" + ], + [ + "BoundDeferredTrigger", + "prefetch when isDataLoaded()" + ], [ "Element", "", "", "" ], - ["BoundAttribute", "[date]=\"current\"", "date", "current"], + [ + "BoundAttribute", + "[date]=\"current\"", + "date", + "current" + ], [ "DeferredBlockPlaceholder", "@placeholder (minimum 500) {Placeholder content!}", "@placeholder (minimum 500) {", "}" ], - ["Text", "Placeholder content!"], + [ + "Text", + "Placeholder content!" + ], [ "DeferredBlockLoading", "@loading (minimum 1s; after 100ms) {Loading...}", "@loading (minimum 1s; after 100ms) {", "}" ], - ["Text", "Loading..."], - ["DeferredBlockError", "@error {Loading failed :(}", "@error {", "}"], - ["Text", "Loading failed :("] + [ + "Text", + "Loading..." + ], + [ + "DeferredBlockError", + "@error {Loading failed :(}", + "@error {", + "}" + ], + [ + "Text", + "Loading failed :(" + ] ], "ignore_error": false } @@ -887,18 +1278,62 @@ "@switch (cond.kind) {", "}" ], - ["SwitchBlockCaseGroup", "@case (x()) {X case}", "@case (x()) {"], - ["SwitchBlockCase", "@case (x()) {X case}", "@case (x()) {"], - ["Text", "X case"], - ["SwitchBlockCaseGroup", "@case ('hello') {Y case}", "@case ('hello') {"], - ["SwitchBlockCase", "@case ('hello') {Y case}", "@case ('hello') {"], - ["Text", "Y case"], - ["SwitchBlockCaseGroup", "@case (42) {Z case}", "@case (42) {"], - ["SwitchBlockCase", "@case (42) {Z case}", "@case (42) {"], - ["Text", "Z case"], - ["SwitchBlockCaseGroup", "@default {No case matched}", "@default {"], - ["SwitchBlockCase", "@default {No case matched}", "@default {"], - ["Text", "No case matched"] + [ + "SwitchBlockCaseGroup", + "@case (x()) {X case}", + "@case (x()) {" + ], + [ + "SwitchBlockCase", + "@case (x()) {X case}", + "@case (x()) {" + ], + [ + "Text", + "X case" + ], + [ + "SwitchBlockCaseGroup", + "@case ('hello') {Y case}", + "@case ('hello') {" + ], + [ + "SwitchBlockCase", + "@case ('hello') {Y case}", + "@case ('hello') {" + ], + [ + "Text", + "Y case" + ], + [ + "SwitchBlockCaseGroup", + "@case (42) {Z case}", + "@case (42) {" + ], + [ + "SwitchBlockCase", + "@case (42) {Z case}", + "@case (42) {" + ], + [ + "Text", + "Z case" + ], + [ + "SwitchBlockCaseGroup", + "@default {No case matched}", + "@default {" + ], + [ + "SwitchBlockCase", + "@default {No case matched}", + "@default {" + ], + [ + "Text", + "No case matched" + ] ], "ignore_error": false } @@ -923,12 +1358,34 @@ "@case (x()) @case ('hello') {X case}", "@case (x()) @case ('hello') {" ], - ["SwitchBlockCase", "@case (x()) ", "@case (x()) "], - ["SwitchBlockCase", "@case ('hello') {X case}", "@case ('hello') {"], - ["Text", "X case"], - ["SwitchBlockCaseGroup", "@default {No case matched}", "@default {"], - ["SwitchBlockCase", "@default {No case matched}", "@default {"], - ["Text", "No case matched"] + [ + "SwitchBlockCase", + "@case (x()) ", + "@case (x()) " + ], + [ + "SwitchBlockCase", + "@case ('hello') {X case}", + "@case ('hello') {" + ], + [ + "Text", + "X case" + ], + [ + "SwitchBlockCaseGroup", + "@default {No case matched}", + "@default {" + ], + [ + "SwitchBlockCase", + "@default {No case matched}", + "@default {" + ], + [ + "Text", + "No case matched" + ] ], "ignore_error": false } @@ -948,10 +1405,25 @@ "@switch (cond.kind) {", "}" ], - ["SwitchBlockCaseGroup", "@case (x()) {X case}", "@case (x()) {"], - ["SwitchBlockCase", "@case (x()) {X case}", "@case (x()) {"], - ["Text", "X case"], - ["SwitchExhaustiveCheck", "@default never;", "@default never;"] + [ + "SwitchBlockCaseGroup", + "@case (x()) {X case}", + "@case (x()) {" + ], + [ + "SwitchBlockCase", + "@case (x()) {X case}", + "@case (x()) {" + ], + [ + "Text", + "X case" + ], + [ + "SwitchExhaustiveCheck", + "@default never;", + "@default never;" + ] ], "ignore_error": false } @@ -977,19 +1449,79 @@ "@for (item of items.foo.bar; track item.id; let i = $index, _o_d_d_ = $odd) {", "}" ], - ["Variable", "item", "item", ""], - ["Variable", "", "", ""], - ["Variable", "", "", ""], - ["Variable", "", "", ""], - ["Variable", "", "", ""], - ["Variable", "", "", ""], - ["Variable", "", "", ""], - ["Variable", "i = $index", "i", "$index"], - ["Variable", "_o_d_d_ = $odd", "_o_d_d_", "$odd"], - ["Element", "

    {{ item }}

    ", "

    ", "

    "], - ["BoundText", "{{ item }}"], - ["ForLoopBlockEmpty", "@empty {There were no items in the list.}", "@empty {"], - ["Text", "There were no items in the list."] + [ + "Variable", + "item", + "item", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "", + "", + "" + ], + [ + "Variable", + "i = $index", + "i", + "$index" + ], + [ + "Variable", + "_o_d_d_ = $odd", + "_o_d_d_", + "$odd" + ], + [ + "Element", + "

    {{ item }}

    ", + "

    ", + "

    " + ], + [ + "BoundText", + "{{ item }}" + ], + [ + "ForLoopBlockEmpty", + "@empty {There were no items in the list.}", + "@empty {" + ], + [ + "Text", + "There were no items in the list." + ] ], "ignore_error": false } @@ -1020,16 +1552,34 @@ "@if (cond.expr; as foo) {Main case was true!}", "@if (cond.expr; as foo) {" ], - ["Variable", "foo", "foo", ""], - ["Text", "Main case was true!"], + [ + "Variable", + "foo", + "foo", + "" + ], + [ + "Text", + "Main case was true!" + ], [ "IfBlockBranch", "@else if (other.expr) {Extra case was true!}", "@else if (other.expr) {" ], - ["Text", "Extra case was true!"], - ["IfBlockBranch", "@else {False case!}", "@else {"], - ["Text", "False case!"] + [ + "Text", + "Extra case was true!" + ], + [ + "IfBlockBranch", + "@else {False case!}", + "@else {" + ], + [ + "Text", + "False case!" + ] ], "ignore_error": false } @@ -1048,7 +1598,14 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123;", - "expected": [["LetDeclaration", "@let foo = 123;", "foo", "123"]], + "expected": [ + [ + "LetDeclaration", + "@let foo = 123;", + "foo", + "123" + ] + ], "ignore_error": false } ] @@ -1066,7 +1623,14 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Component", "", "", ""]], + "expected": [ + [ + "Component", + "", + "", + "" + ] + ], "ignore_error": true } ] @@ -1078,7 +1642,14 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Component", "", "", ""]], + "expected": [ + [ + "Component", + "", + "", + "" + ] + ], "ignore_error": true } ] @@ -1116,14 +1687,52 @@ "", "" ], - ["TextAttribute", "before=\"foo\"", "before", "foo"], - ["TextAttribute", "middle", "middle", ""], - ["TextAttribute", "after=\"123\"", "after", "123"], - ["Directive", "@Dir", "@Dir", ""], - ["Directive", "@OtherDir([a]=\"a\" (b)=\"b()\")", "@OtherDir(", ")"], - ["BoundAttribute", "[a]=\"a\"", "a", "a"], - ["BoundEvent", "(b)=\"b()\"", "b", "b()"], - ["Text", "Hello"] + [ + "TextAttribute", + "before=\"foo\"", + "before", + "foo" + ], + [ + "TextAttribute", + "middle", + "middle", + "" + ], + [ + "TextAttribute", + "after=\"123\"", + "after", + "123" + ], + [ + "Directive", + "@Dir", + "@Dir", + "" + ], + [ + "Directive", + "@OtherDir([a]=\"a\" (b)=\"b()\")", + "@OtherDir(", + ")" + ], + [ + "BoundAttribute", + "[a]=\"a\"", + "a", + "a" + ], + [ + "BoundEvent", + "(b)=\"b()\"", + "b", + "b()" + ], + [ + "Text", + "Hello" + ] ], "ignore_error": true } @@ -1154,15 +1763,28 @@ "
    ", "
    " ], - ["Text", "Hello: "], + [ + "Text", + "Hello: " + ], [ "Component", "", "", "" ], - ["Element", "", "", ""], - ["Component", "", "", ""] + [ + "Element", + "", + "", + "" + ], + [ + "Component", + "", + "", + "" + ] ], "ignore_error": true } @@ -1182,8 +1804,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Directive", "@Dir", "@Dir", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Directive", + "@Dir", + "@Dir", + "" + ] ], "ignore_error": true } @@ -1203,10 +1835,30 @@ "
    ", "
    " ], - ["Directive", "@Dir(a=\"1\" [b]=\"two\" (c)=\"c()\")", "@Dir(", ")"], - ["TextAttribute", "a=\"1\"", "a", "1"], - ["BoundAttribute", "[b]=\"two\"", "b", "two"], - ["BoundEvent", "(c)=\"c()\"", "c", "c()"] + [ + "Directive", + "@Dir(a=\"1\" [b]=\"two\" (c)=\"c()\")", + "@Dir(", + ")" + ], + [ + "TextAttribute", + "a=\"1\"", + "a", + "1" + ], + [ + "BoundAttribute", + "[b]=\"two\"", + "b", + "two" + ], + [ + "BoundEvent", + "(c)=\"c()\"", + "c", + "c()" + ] ], "ignore_error": true } @@ -1226,13 +1878,48 @@ "
    ", "
    " ], - ["TextAttribute", "before=\"foo\"", "before", "foo"], - ["TextAttribute", "middle", "middle", ""], - ["TextAttribute", "after=\"123\"", "after", "123"], - ["Directive", "@Dir", "@Dir", ""], - ["Directive", "@OtherDir([a]=\"a\" (b)=\"b()\")", "@OtherDir(", ")"], - ["BoundAttribute", "[a]=\"a\"", "a", "a"], - ["BoundEvent", "(b)=\"b()\"", "b", "b()"] + [ + "TextAttribute", + "before=\"foo\"", + "before", + "foo" + ], + [ + "TextAttribute", + "middle", + "middle", + "" + ], + [ + "TextAttribute", + "after=\"123\"", + "after", + "123" + ], + [ + "Directive", + "@Dir", + "@Dir", + "" + ], + [ + "Directive", + "@OtherDir([a]=\"a\" (b)=\"b()\")", + "@OtherDir(", + ")" + ], + [ + "BoundAttribute", + "[a]=\"a\"", + "a", + "a" + ], + [ + "BoundEvent", + "(b)=\"b()\"", + "b", + "b()" + ] ], "ignore_error": true } diff --git a/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json b/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json index c1794704f0..4c39898728 100644 --- a/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json @@ -16,6 +16,85 @@ } ] }, + { + "name": "Boundary blocks", + "groups": [], + "tests": [ + { + "name": "should parse @boundary blocks with multiple @error blocks", + "path": "R3 template transform/Boundary blocks/should parse @boundary blocks with multiple @error blocks", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "\n @boundary {\n
    Content
    \n } @error (when err instanceof SpecificError) {\n
    Specific Error
    \n } @error (let err) {\n
    General Error {{ err }}
    \n }\n ", + "expected": [ + [ + "BoundaryBlock" + ], + [ + "Element", + "div" + ], + [ + "Text", + "Content" + ], + [ + "BoundaryErrorBlock", + "err instanceof SpecificError" + ], + [ + "Variable", + "$error", + "$error" + ], + [ + "Variable", + "$reset", + "$reset" + ], + [ + "Element", + "div" + ], + [ + "Text", + "Specific Error" + ], + [ + "BoundaryErrorBlock", + null + ], + [ + "Variable", + "$error", + "$error" + ], + [ + "Variable", + "$reset", + "$reset" + ], + [ + "Variable", + "err", + "$error" + ], + [ + "Element", + "div" + ], + [ + "BoundText", + "General Error {{ err }}" + ] + ], + "ignore_error": false + } + ] + } + ] + }, { "name": "Nodes without binding", "groups": [], @@ -27,7 +106,12 @@ { "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "a"], - ["Element", "span"] + [ + "Element", + "a" + ], + [ + "Element", + "span" + ] ], "ignore_error": true } @@ -54,7 +144,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -67,8 +162,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "a", "b"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "a", + "b" + ] ], "ignore_error": false } @@ -87,8 +189,15 @@ "type": "ExpectFromHtml", "input": " \n ", "expected": [ - ["Content", "a"], - ["TextAttribute", "select", "a"] + [ + "Content", + "a" + ], + [ + "TextAttribute", + "select", + "a" + ] ], "ignore_error": false } @@ -102,9 +211,19 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", ":svg:svg"], - ["Content", "a"], - ["TextAttribute", "select", "a"] + [ + "Element", + ":svg:svg" + ], + [ + "Content", + "a" + ], + [ + "TextAttribute", + "select", + "a" + ] ], "ignore_error": false } @@ -128,7 +247,12 @@ { "type": "ExpectFromHtml", "input": "{{a}}", - "expected": [["BoundText", "{{ a }}"]], + "expected": [ + [ + "BoundText", + "{{ a }}" + ] + ], "ignore_error": false } ] @@ -147,8 +271,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "someProp", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "someProp", + "v" + ] ], "ignore_error": false } @@ -162,8 +294,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "prop", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "prop", + "v" + ] ], "ignore_error": false } @@ -182,8 +322,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "prop", "{{ v }}"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "prop", + "{{ v }}" + ] ], "ignore_error": false } @@ -197,8 +345,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "some-prop", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "some-prop", + "v" + ] ], "ignore_error": false } @@ -212,8 +368,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "d.ot", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "d.ot", + "v" + ] ], "ignore_error": false } @@ -227,8 +391,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "mappedAttr", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "mappedAttr", + "v" + ] ], "ignore_error": false } @@ -242,8 +414,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 1, "someAttr", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 1, + "someAttr", + "v" + ] ], "ignore_error": false } @@ -257,8 +437,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 2, "some-class", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 2, + "some-class", + "v" + ] ], "ignore_error": false } @@ -272,8 +460,45 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 2, "someClass", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 2, + "someClass", + "v" + ] + ], + "ignore_error": false + } + ] + }, + { + "name": "should parse bound classes with dots in the name", + "path": "R3 template transform/Bound attributes/should parse bound classes with dots in the name", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "
    ", + "expected": [ + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 2, + "px-3.5", + "v" + ], + [ + "BoundAttribute", + 2, + "a.b.c", + "w" + ] ], "ignore_error": false } @@ -287,8 +512,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 3, "someStyle", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 3, + "someStyle", + "v" + ] ], "ignore_error": false } @@ -302,15 +535,43 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "foo", "#selfClosing"], - ["TextAttribute", "some-attr", ""], - ["BoundAttribute", 2, "text-primary/80", "expr"], - ["BoundAttribute", 2, "data-active:text-green-300/80", "expr2"], - ["BoundAttribute", 2, "data-[size='large']:p-8", "expr3"] + [ + "Element", + "foo", + "#selfClosing" + ], + [ + "TextAttribute", + "some-attr", + "" + ], + [ + "BoundAttribute", + 2, + "text-primary/80", + "expr" + ], + [ + "BoundAttribute", + 2, + "data-active:text-green-300/80", + "expr2" + ], + [ + "BoundAttribute", + 2, + "data-[size='large']:p-8", + "expr3" + ] ], "ignore_error": false } ] + }, + { + "name": "should not attach i18n metadata for bound properties named after Object.prototype members", + "path": "R3 template transform/Bound attributes/should not attach i18n metadata for bound properties named after Object.prototype members", + "assertions": [] } ] }, @@ -326,8 +587,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "animate.enter", "foo"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "animate.enter", + "foo" + ] ], "ignore_error": false }, @@ -335,8 +603,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 6.0, "animate.enter", "[\"foo\", \"bar\"]"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 6.0, + "animate.enter", + "[\"foo\", \"bar\"]" + ] ], "ignore_error": false }, @@ -344,8 +620,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 3.0, "animate.enter", null, "animateFn($event)"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 3.0, + "animate.enter", + null, + "animateFn($event)" + ] ], "ignore_error": false } @@ -359,8 +644,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "animate.leave", "foo"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "animate.leave", + "foo" + ] ], "ignore_error": false }, @@ -368,8 +660,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 6.0, "animate.leave", "[\"foo\", \"bar\"]"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 6.0, + "animate.leave", + "[\"foo\", \"bar\"]" + ] ], "ignore_error": false }, @@ -377,8 +677,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 3.0, "animate.leave", null, "animateFn($event)"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 3.0, + "animate.leave", + null, + "animateFn($event)" + ] ], "ignore_error": false }, @@ -386,8 +695,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0.0, "animateXYZ", null, "animateFn()"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0.0, + "animateXYZ", + null, + "animateFn()" + ] ], "ignore_error": false } @@ -406,7 +724,20 @@ { "type": "ExpectFromHtml", "input": "
    ", - "expected": [["Template"], ["TextAttribute", "ngIf", ""], ["Element", "div"]], + "expected": [ + [ + "Template" + ], + [ + "TextAttribute", + "ngIf", + "" + ], + [ + "Element", + "div" + ] + ], "ignore_error": false } ] @@ -418,7 +749,11 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"]], + "expected": [ + [ + "Template" + ] + ], "ignore_error": false } ] @@ -430,7 +765,15 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Element", ":svg:svg"], ["Template"]], + "expected": [ + [ + "Element", + ":svg:svg" + ], + [ + "Template" + ] + ], "ignore_error": false } ] @@ -442,7 +785,20 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["BoundAttribute", 0.0, "ngIf", "true"], ["Template"]], + "expected": [ + [ + "Template" + ], + [ + "BoundAttribute", + 0.0, + "ngIf", + "true" + ], + [ + "Template" + ] + ], "ignore_error": false } ] @@ -454,7 +810,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Reference", "a", ""]], + "expected": [ + [ + "Template" + ], + [ + "Reference", + "a", + "" + ] + ], "ignore_error": false } ] @@ -466,7 +831,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Reference", "a", ""]], + "expected": [ + [ + "Template" + ], + [ + "Reference", + "a", + "" + ] + ], "ignore_error": false } ] @@ -483,7 +857,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Variable", "a", "b"]], + "expected": [ + [ + "Template" + ], + [ + "Variable", + "a", + "b" + ] + ], "ignore_error": false } ] @@ -496,9 +879,19 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Template"], - ["TextAttribute", "k1", "v1"], - ["TextAttribute", "k2", "v2"] + [ + "Template" + ], + [ + "TextAttribute", + "k1", + "v1" + ], + [ + "TextAttribute", + "k2", + "v2" + ] ], "ignore_error": false } @@ -512,9 +905,21 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Template"], - ["BoundAttribute", 0, "k1", "v1"], - ["BoundAttribute", 0, "k2", "v2"] + [ + "Template" + ], + [ + "BoundAttribute", + 0, + "k1", + "v1" + ], + [ + "BoundAttribute", + 0, + "k2", + "v2" + ] ], "ignore_error": false } @@ -534,11 +939,29 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Template"], - ["TextAttribute", "ngFor", ""], - ["BoundAttribute", 0, "ngForOf", "items"], - ["Variable", "item", "$implicit"], - ["Element", "div"] + [ + "Template" + ], + [ + "TextAttribute", + "ngFor", + "" + ], + [ + "BoundAttribute", + 0, + "ngForOf", + "items" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Element", + "div" + ] ], "ignore_error": false }, @@ -546,10 +969,25 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Template"], - ["BoundAttribute", 0, "ngFor", "item"], - ["BoundAttribute", 0, "ngForOf", "items"], - ["Element", "div"] + [ + "Template" + ], + [ + "BoundAttribute", + 0, + "ngFor", + "item" + ], + [ + "BoundAttribute", + 0, + "ngForOf", + "items" + ], + [ + "Element", + "div" + ] ], "ignore_error": false } @@ -563,10 +1001,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Template"], - ["TextAttribute", "ngIf", ""], - ["Variable", "a", "b"], - ["Element", "div"] + [ + "Template" + ], + [ + "TextAttribute", + "ngIf", + "" + ], + [ + "Variable", + "a", + "b" + ], + [ + "Element", + "div" + ] ], "ignore_error": false } @@ -580,10 +1031,24 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Template"], - ["BoundAttribute", 0, "ngIf", "expr"], - ["Variable", "local", "ngIf"], - ["Element", "div"] + [ + "Template" + ], + [ + "BoundAttribute", + 0, + "ngIf", + "expr" + ], + [ + "Variable", + "local", + "ngIf" + ], + [ + "Element", + "div" + ] ], "ignore_error": false } @@ -603,8 +1068,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "event", "window", "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "event", + "window", + "v" + ] ], "ignore_error": false } @@ -618,8 +1092,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "some-event", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "some-event", + null, + "v" + ] ], "ignore_error": false }, @@ -627,8 +1110,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "someEvent", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "someEvent", + null, + "v" + ] ], "ignore_error": false } @@ -642,8 +1134,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "event", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "event", + null, + "v" + ] ], "ignore_error": false } @@ -662,9 +1163,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "v"], - ["BoundEvent", 2, "propChange", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "v" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "v" + ] ], "ignore_error": false } @@ -678,9 +1193,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "$any(v)"], - ["BoundEvent", 2, "propChange", null, "$any(v)"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "$any(v)" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "$any(v)" + ] ], "ignore_error": false } @@ -694,9 +1223,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "v"], - ["BoundEvent", 2, "propChange", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "v" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "v" + ] ], "ignore_error": false } @@ -710,9 +1253,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "v!"], - ["BoundEvent", 2, "propChange", null, "v!"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "v!" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "v!" + ] ], "ignore_error": false } @@ -726,9 +1283,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "a.b.c"], - ["BoundEvent", 2, "propChange", null, "a.b.c"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "a.b.c" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "a.b.c" + ] ], "ignore_error": false } @@ -742,9 +1313,23 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 5, "prop", "a[\"b\"][\"c\"]"], - ["BoundEvent", 2, "propChange", null, "a[\"b\"][\"c\"]"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 5, + "prop", + "a[\"b\"][\"c\"]" + ], + [ + "BoundEvent", + 2, + "propChange", + null, + "a[\"b\"][\"c\"]" + ] ], "ignore_error": false } @@ -788,8 +1373,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 1, "", null, "onAnimationEvent($event)"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 1, + "", + null, + "onAnimationEvent($event)" + ] ], "ignore_error": true } @@ -830,8 +1424,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "a", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "a", + "" + ] ], "ignore_error": false } @@ -845,8 +1446,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "a", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "a", + "" + ] ], "ignore_error": false } @@ -860,8 +1468,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "someA", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "someA", + "" + ] ], "ignore_error": false } @@ -953,7 +1568,42 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], + "ignore_error": false + } + ] + }, + { + "name": "should ignore safe", + "expected": [ + [ + "Element", + ":xhtml:div" + ], + [ + "TextAttribute", + ":xmlns:xhtml", + "http://www.w3.org/1999/xhtml" + ], + [ + "Element", + ":xhtml:span" + ], + [ + "Text", + "safe" + ] + ], "ignore_error": false } ] @@ -965,7 +1615,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -978,9 +1633,18 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", ":svg:svg"], - ["Element", ":svg:style"], - ["Text", ".a { fill: none; }"] + [ + "Element", + ":svg:svg" + ], + [ + "Element", + ":svg:style" + ], + [ + "Text", + ".a { fill: none; }" + ] ], "ignore_error": false } @@ -1000,9 +1664,20 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "rel", "stylesheet"], - ["TextAttribute", "href", "http://someurl"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "rel", + "stylesheet" + ], + [ + "TextAttribute", + "href", + "http://someurl" + ] ], "ignore_error": false }, @@ -1010,9 +1685,20 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "REL", "stylesheet"], - ["TextAttribute", "href", "http://someurl"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "REL", + "stylesheet" + ], + [ + "TextAttribute", + "href", + "http://someurl" + ] ], "ignore_error": false } @@ -1026,8 +1712,15 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "rel", "stylesheet"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "rel", + "stylesheet" + ] ], "ignore_error": false }, @@ -1035,8 +1728,15 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "REL", "stylesheet"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "REL", + "stylesheet" + ] ], "ignore_error": false } @@ -1074,9 +1774,19 @@ "type": "ExpectFromHtml", "input": "
    {{b}}
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "{{b}}"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "{{b}}" + ] ], "ignore_error": false } @@ -1090,10 +1800,23 @@ "type": "ExpectFromHtml", "input": "
    {{b}}
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Element", "span"], - ["Text", "{{b}}"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Element", + "span" + ], + [ + "Text", + "{{b}}" + ] ], "ignore_error": false } @@ -1107,9 +1830,49 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] + ], + "ignore_error": false + } + ] + }, + { + "name": "should ignore custom-namespaced safe", + "expected": [ + [ + "Element", + ":foo:div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Element", + ":foo:span" + ], + [ + "Text", + "safe" + ] ], "ignore_error": false } @@ -1123,9 +1886,19 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] ], "ignore_error": false } @@ -1139,9 +1912,19 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] ], "ignore_error": false } @@ -1274,9 +2057,17 @@ "type": "ExpectFromHtml", "input": "@defer (on idle(1)) {hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger", 1.0], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger", + 1.0 + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1423,7 +2214,15 @@ { "type": "ExpectFromHtml", "input": "@defer{hello}", - "expected": [["DeferredBlock"], ["Text", "hello"]], + "expected": [ + [ + "DeferredBlock" + ], + [ + "Text", + "hello" + ] + ], "ignore_error": false } ] @@ -1436,9 +2235,17 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible() && loaded){hello}", "expected": [ - ["DeferredBlock"], - ["BoundDeferredTrigger", "isVisible() && loaded"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "BoundDeferredTrigger", + "isVisible() && loaded" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1451,7 +2258,18 @@ { "type": "ExpectFromHtml", "input": "@defer (on idle){hello}", - "expected": [["DeferredBlock"], ["IdleDeferredTrigger"], ["Text", "hello"]], + "expected": [ + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] + ], "ignore_error": false } ] @@ -1464,10 +2282,20 @@ "type": "ExpectFromHtml", "input": "@defer (on idle, viewport(button)){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1481,11 +2309,23 @@ "type": "ExpectFromHtml", "input": "@defer (on idle, viewport(button), immediate){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["ImmediateDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "ImmediateDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1499,12 +2339,28 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible(); on timer(100ms), idle, viewport(button)){hello}", "expected": [ - ["DeferredBlock"], - ["BoundDeferredTrigger", "isVisible()"], - ["TimerDeferredTrigger", 100.0], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "BoundDeferredTrigger", + "isVisible()" + ], + [ + "TimerDeferredTrigger", + 100.0 + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1518,12 +2374,28 @@ "type": "ExpectFromHtml", "input": "@defer(\nwhen\nisVisible(); on\ntimer(100ms),\nidle, viewport(button)){hello}", "expected": [ - ["DeferredBlock"], - ["BoundDeferredTrigger", "isVisible()"], - ["TimerDeferredTrigger", 100.0], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "BoundDeferredTrigger", + "isVisible()" + ], + [ + "TimerDeferredTrigger", + 100.0 + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1537,9 +2409,17 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(10s)){hello}", "expected": [ - ["DeferredBlock"], - ["TimerDeferredTrigger", 10000.0], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "TimerDeferredTrigger", + 10000.0 + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1553,9 +2433,17 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(1.5s)){hello}", "expected": [ - ["DeferredBlock"], - ["TimerDeferredTrigger", 1500.0], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "TimerDeferredTrigger", + 1500.0 + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1569,9 +2457,17 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(100)){hello}", "expected": [ - ["DeferredBlock"], - ["TimerDeferredTrigger", 100.0], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "TimerDeferredTrigger", + 100.0 + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1585,9 +2481,17 @@ "type": "ExpectFromHtml", "input": "@defer (on hover(button)){hello}", "expected": [ - ["DeferredBlock"], - ["HoverDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "HoverDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1601,9 +2505,17 @@ "type": "ExpectFromHtml", "input": "@defer (on interaction(button)){hello}", "expected": [ - ["DeferredBlock"], - ["InteractionDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "InteractionDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1617,15 +2529,41 @@ "type": "ExpectFromHtml", "input": "@defer {}@loading {Loading...}@placeholder {Placeholder content!}@error {Loading failed :(}", "expected": [ - ["DeferredBlock"], - ["Element", "calendar-cmp", "#selfClosing"], - ["BoundAttribute", 0.0, "date", "current"], - ["DeferredBlockPlaceholder"], - ["Text", "Placeholder content!"], - ["DeferredBlockLoading"], - ["Text", "Loading..."], - ["DeferredBlockError"], - ["Text", "Loading failed :("] + [ + "DeferredBlock" + ], + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "BoundAttribute", + 0.0, + "date", + "current" + ], + [ + "DeferredBlockPlaceholder" + ], + [ + "Text", + "Placeholder content!" + ], + [ + "DeferredBlockLoading" + ], + [ + "Text", + "Loading..." + ], + [ + "DeferredBlockError" + ], + [ + "Text", + "Loading failed :(" + ] ], "ignore_error": false } @@ -1639,15 +2577,41 @@ "type": "ExpectFromHtml", "input": "@defer {} @loading {Loading...} @placeholder {Placeholder content!} @error {Loading failed :(}", "expected": [ - ["DeferredBlock"], - ["Element", "calendar-cmp", "#selfClosing"], - ["BoundAttribute", 0.0, "date", "current"], - ["DeferredBlockPlaceholder"], - ["Text", "Placeholder content!"], - ["DeferredBlockLoading"], - ["Text", "Loading..."], - ["DeferredBlockError"], - ["Text", "Loading failed :("] + [ + "DeferredBlock" + ], + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "BoundAttribute", + 0.0, + "date", + "current" + ], + [ + "DeferredBlockPlaceholder" + ], + [ + "Text", + "Placeholder content!" + ], + [ + "DeferredBlockLoading" + ], + [ + "Text", + "Loading..." + ], + [ + "DeferredBlockError" + ], + [ + "Text", + "Loading failed :(" + ] ], "ignore_error": false } @@ -1666,11 +2630,29 @@ "type": "ExpectFromHtml", "input": "@defer{}@loading (after 100ms; minimum 1.5s){Loading...}", "expected": [ - ["DeferredBlock"], - ["Element", "calendar-cmp", "#selfClosing"], - ["BoundAttribute", 0.0, "date", "current"], - ["DeferredBlockLoading", "after 100ms", "minimum 1500ms"], - ["Text", "Loading..."] + [ + "DeferredBlock" + ], + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "BoundAttribute", + 0.0, + "date", + "current" + ], + [ + "DeferredBlockLoading", + "after 100ms", + "minimum 1500ms" + ], + [ + "Text", + "Loading..." + ] ], "ignore_error": false } @@ -1684,11 +2666,28 @@ "type": "ExpectFromHtml", "input": "@defer {}@placeholder (minimum 1.5s){Placeholder...}", "expected": [ - ["DeferredBlock"], - ["Element", "calendar-cmp", "#selfClosing"], - ["BoundAttribute", 0.0, "date", "current"], - ["DeferredBlockPlaceholder", "minimum 1500ms"], - ["Text", "Placeholder..."] + [ + "DeferredBlock" + ], + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "BoundAttribute", + 0.0, + "date", + "current" + ], + [ + "DeferredBlockPlaceholder", + "minimum 1500ms" + ], + [ + "Text", + "Placeholder..." + ] ], "ignore_error": false } @@ -1702,12 +2701,28 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on viewport(button), hover(button); prefetch when shouldPrefetch()){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["HoverDeferredTrigger", "button"], - ["BoundDeferredTrigger", "shouldPrefetch()"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "HoverDeferredTrigger", + "button" + ], + [ + "BoundDeferredTrigger", + "shouldPrefetch()" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1721,10 +2736,20 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on idle(100)){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger"], - ["IdleDeferredTrigger", 100.0], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "IdleDeferredTrigger", + 100.0 + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1738,10 +2763,20 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on idle(100)){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger", 100.0], - ["IdleDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger", + 100.0 + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1755,12 +2790,28 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on viewport(button), hover(button); prefetch when shouldPrefetch()){hello}", "expected": [ - ["DeferredBlock"], - ["IdleDeferredTrigger"], - ["ViewportDeferredTrigger", "button"], - ["HoverDeferredTrigger", "button"], - ["BoundDeferredTrigger", "shouldPrefetch()"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "ViewportDeferredTrigger", + "button" + ], + [ + "HoverDeferredTrigger", + "button" + ], + [ + "BoundDeferredTrigger", + "shouldPrefetch()" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1774,10 +2825,19 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate never){hello}", "expected": [ - ["DeferredBlock"], - ["NeverDeferredTrigger"], - ["IdleDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "NeverDeferredTrigger" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1791,13 +2851,32 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on viewport, hover, timer(500); hydrate when shouldHydrate()){hello}", "expected": [ - ["DeferredBlock"], - ["ViewportDeferredTrigger", null], - ["HoverDeferredTrigger", null], - ["TimerDeferredTrigger", 500.0], - ["BoundDeferredTrigger", "shouldHydrate()"], - ["IdleDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "ViewportDeferredTrigger", + null + ], + [ + "HoverDeferredTrigger", + null + ], + [ + "TimerDeferredTrigger", + 500.0 + ], + [ + "BoundDeferredTrigger", + "shouldHydrate()" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1811,12 +2890,28 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on viewport, hover; hydrate when shouldHydrate()){hello}", "expected": [ - ["DeferredBlock"], - ["ViewportDeferredTrigger", null], - ["HoverDeferredTrigger", null], - ["BoundDeferredTrigger", "shouldHydrate()"], - ["IdleDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "ViewportDeferredTrigger", + null + ], + [ + "HoverDeferredTrigger", + null + ], + [ + "BoundDeferredTrigger", + "shouldHydrate()" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1830,26 +2925,85 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){}@loading (minimum 1s; after 100ms){Loading...}@placeholder (minimum 500){Placeholder content!}@error {Loading failed :(}", "expected": [ - ["DeferredBlock"], - ["BoundDeferredTrigger", "shouldHydrate()"], - ["ViewportDeferredTrigger", null], - ["BoundDeferredTrigger", "isVisible() && foo"], - ["HoverDeferredTrigger", "button"], - ["TimerDeferredTrigger", 10000.0], - ["IdleDeferredTrigger"], - ["ImmediateDeferredTrigger"], - ["InteractionDeferredTrigger", "button"], - ["ViewportDeferredTrigger", "container"], - ["ImmediateDeferredTrigger"], - ["BoundDeferredTrigger", "isDataLoaded()"], - ["Element", "calendar-cmp", "#selfClosing"], - ["BoundAttribute", 0.0, "date", "current"], - ["DeferredBlockPlaceholder", "minimum 500ms"], - ["Text", "Placeholder content!"], - ["DeferredBlockLoading", "after 100ms", "minimum 1000ms"], - ["Text", "Loading..."], - ["DeferredBlockError"], - ["Text", "Loading failed :("] + [ + "DeferredBlock" + ], + [ + "BoundDeferredTrigger", + "shouldHydrate()" + ], + [ + "ViewportDeferredTrigger", + null + ], + [ + "BoundDeferredTrigger", + "isVisible() && foo" + ], + [ + "HoverDeferredTrigger", + "button" + ], + [ + "TimerDeferredTrigger", + 10000.0 + ], + [ + "IdleDeferredTrigger" + ], + [ + "ImmediateDeferredTrigger" + ], + [ + "InteractionDeferredTrigger", + "button" + ], + [ + "ViewportDeferredTrigger", + "container" + ], + [ + "ImmediateDeferredTrigger" + ], + [ + "BoundDeferredTrigger", + "isDataLoaded()" + ], + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "BoundAttribute", + 0.0, + "date", + "current" + ], + [ + "DeferredBlockPlaceholder", + "minimum 500ms" + ], + [ + "Text", + "Placeholder content!" + ], + [ + "DeferredBlockLoading", + "after 100ms", + "minimum 1000ms" + ], + [ + "Text", + "Loading..." + ], + [ + "DeferredBlockError" + ], + [ + "Text", + "Loading failed :(" + ] ], "ignore_error": false } @@ -1863,24 +3017,69 @@ "type": "ExpectFromHtml", "input": "
    @defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){}@loading (minimum 1s; after 100ms){Loading...}@placeholder (minimum 500){Placeholder content!}@error {Loading failed :(}
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], [ "Text", "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){" ], - ["Element", "calendar-cmp", "#selfClosing"], - ["TextAttribute", "[date]", "current"], - ["Text", "}"], - ["Text", "@loading (minimum 1s; after 100ms){"], - ["Text", "Loading..."], - ["Text", "}"], - ["Text", "@placeholder (minimum 500){"], - ["Text", "Placeholder content!"], - ["Text", "}"], - ["Text", "@error {"], - ["Text", "Loading failed :("], - ["Text", "}"] + [ + "Element", + "calendar-cmp", + "#selfClosing" + ], + [ + "TextAttribute", + "[date]", + "current" + ], + [ + "Text", + "}" + ], + [ + "Text", + "@loading (minimum 1s; after 100ms){" + ], + [ + "Text", + "Loading..." + ], + [ + "Text", + "}" + ], + [ + "Text", + "@placeholder (minimum 500){" + ], + [ + "Text", + "Placeholder content!" + ], + [ + "Text", + "}" + ], + [ + "Text", + "@error {" + ], + [ + "Text", + "Loading failed :(" + ], + [ + "Text", + "}" + ] ], "ignore_error": false } @@ -1894,16 +3093,45 @@ "type": "ExpectFromHtml", "input": "@defer (on hover, interaction, viewport; prefetch on hover, interaction, viewport) {hello}@placeholder {}", "expected": [ - ["DeferredBlock"], - ["HoverDeferredTrigger", null], - ["InteractionDeferredTrigger", null], - ["ViewportDeferredTrigger", null], - ["HoverDeferredTrigger", null], - ["InteractionDeferredTrigger", null], - ["ViewportDeferredTrigger", null], - ["Text", "hello"], - ["DeferredBlockPlaceholder"], - ["Element", "implied-trigger", "#selfClosing"] + [ + "DeferredBlock" + ], + [ + "HoverDeferredTrigger", + null + ], + [ + "InteractionDeferredTrigger", + null + ], + [ + "ViewportDeferredTrigger", + null + ], + [ + "HoverDeferredTrigger", + null + ], + [ + "InteractionDeferredTrigger", + null + ], + [ + "ViewportDeferredTrigger", + null + ], + [ + "Text", + "hello" + ], + [ + "DeferredBlockPlaceholder" + ], + [ + "Element", + "implied-trigger", + "#selfClosing" + ] ], "ignore_error": false } @@ -1915,15 +3143,20 @@ "assertions": [ { "type": "ExpectFromHtml", - "input": "@defer (on viewport({trigger: foo, rootMargin: \"123px\", threshold: [1, 2, 3]})){hello}", + "input": "@defer (on viewport({trigger: foo, rootMargin: \"123px\", scrollMargin: \"456px\", threshold: [1, 2, 3]})){hello}", "expected": [ - ["DeferredBlock"], + [ + "DeferredBlock" + ], [ "ViewportDeferredTrigger", "foo", - "{rootMargin: \"123px\", threshold: [1, 2, 3]}" + "{rootMargin: \"123px\", scrollMargin: \"456px\", threshold: [1, 2, 3]}" ], - ["Text", "hello"] + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1937,9 +3170,18 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({rootMargin: \"123px\"})){hello}", "expected": [ - ["DeferredBlock"], - ["ViewportDeferredTrigger", null, "{rootMargin: \"123px\"}"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "ViewportDeferredTrigger", + null, + "{rootMargin: \"123px\"}" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false }, @@ -1947,9 +3189,18 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({rootMargin: \"123px\"})){hello}", "expected": [ - ["DeferredBlock"], - ["ViewportDeferredTrigger", null, "{rootMargin: \"123px\"}"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "ViewportDeferredTrigger", + null, + "{rootMargin: \"123px\"}" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -2046,20 +3297,58 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n @case (x()) { X case }\n @case ('hello') {}\n @case (42) { Z case }\n @default { No case matched }\n }\n ", "expected": [ - ["SwitchBlock", "cond.kind"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "x()"], - ["Text", " X case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"hello\""], - ["Element", "button"], - ["Text", "Y case"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "42"], - ["Text", " Z case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["Text", " No case matched "] + [ + "SwitchBlock", + "cond.kind" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "x()" + ], + [ + "Text", + " X case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"hello\"" + ], + [ + "Element", + "button" + ], + [ + "Text", + "Y case" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "42" + ], + [ + "Text", + " Z case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "Text", + " No case matched " + ] ], "ignore_error": false } @@ -2071,10 +3360,32 @@ "assertions": [ { "type": "ExpectFromHtml", - "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", - "expected": [["SwitchBlock", "cond.kind"], ["SwitchExhaustiveCheck"]], + "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", + "expected": [ + [ + "SwitchBlock", + "cond.kind" + ], + [ + "SwitchExhaustiveCheck" + ] + ], "ignore_error": false - } + }, + { + "type": "ExpectFromHtml", + "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", + "expected": [ + [ + "SwitchBlock", + "cond.kind" + ], + [ + "SwitchExhaustiveCheck" + ] + ], + "ignore_error": false + } ] }, { @@ -2090,20 +3401,58 @@ "type": "ExpectFromHtml", "input": "\n @switch ((cond.kind)) {\n @case ((x())) { X case }\n @case (('hello')) {}\n @case ((42)) { Z case }\n @default { No case matched }\n }\n ", "expected": [ - ["SwitchBlock", "(cond.kind)"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "(x())"], - ["Text", " X case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "(\"hello\")"], - ["Element", "button"], - ["Text", "Y case"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "(42)"], - ["Text", " Z case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["Text", " No case matched "] + [ + "SwitchBlock", + "(cond.kind)" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "(x())" + ], + [ + "Text", + " X case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "(\"hello\")" + ], + [ + "Element", + "button" + ], + [ + "Text", + "Y case" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "(42)" + ], + [ + "Text", + " Z case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "Text", + " No case matched " + ] ], "ignore_error": false } @@ -2117,41 +3466,135 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond) {\n @case ('a') {\n @switch (innerCond) {\n @case ('innerA') { Inner A }\n @case ('innerB') { Inner B }\n }\n }\n @case ('b') {}\n @case ('c') { Z case }\n @default {\n @switch (innerCond) {\n @case ('innerC') { Inner C }\n @case ('innerD') { Inner D }\n @default {\n @switch (innerInnerCond) {\n @case ('innerInnerA') { Inner inner A }\n @case ('innerInnerA') { Inner inner B }\n }\n }\n }\n }\n }\n ", "expected": [ - ["SwitchBlock", "cond"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"a\""], - ["SwitchBlock", "innerCond"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerA\""], - ["Text", " Inner A "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerB\""], - ["Text", " Inner B "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"b\""], - ["Element", "button"], - ["Text", "Y case"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"c\""], - ["Text", " Z case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["SwitchBlock", "innerCond"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerC\""], - ["Text", " Inner C "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerD\""], - ["Text", " Inner D "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["SwitchBlock", "innerInnerCond"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerInnerA\""], - ["Text", " Inner inner A "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"innerInnerA\""], - ["Text", " Inner inner B "] + [ + "SwitchBlock", + "cond" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"a\"" + ], + [ + "SwitchBlock", + "innerCond" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerA\"" + ], + [ + "Text", + " Inner A " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerB\"" + ], + [ + "Text", + " Inner B " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"b\"" + ], + [ + "Element", + "button" + ], + [ + "Text", + "Y case" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"c\"" + ], + [ + "Text", + " Z case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "SwitchBlock", + "innerCond" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerC\"" + ], + [ + "Text", + " Inner C " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerD\"" + ], + [ + "Text", + " Inner D " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "SwitchBlock", + "innerInnerCond" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerInnerA\"" + ], + [ + "Text", + " Inner inner A " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"innerInnerA\"" + ], + [ + "Text", + " Inner inner B " + ] ], "ignore_error": false } @@ -2165,13 +3608,32 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n \n @case (x) { X case }\n\n \n @default { No case matched }\n }\n ", "expected": [ - ["SwitchBlock", "cond.kind"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "x"], - ["Text", " X case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["Text", " No case matched "] + [ + "SwitchBlock", + "cond.kind" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "x" + ], + [ + "Text", + " X case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "Text", + " No case matched " + ] ], "ignore_error": false } @@ -2185,19 +3647,55 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond) {\n @case ('a') @case('b') @case('c') @case('d') { ABCD case }\n @case ('z') { Z case }\n @default { No case matched }\n }\n ", "expected": [ - ["SwitchBlock", "cond"], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"a\""], - ["SwitchBlockCase", "\"b\""], - ["SwitchBlockCase", "\"c\""], - ["SwitchBlockCase", "\"d\""], - ["Text", " ABCD case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", "\"z\""], - ["Text", " Z case "], - ["SwitchBlockCaseGroup"], - ["SwitchBlockCase", null], - ["Text", " No case matched "] + [ + "SwitchBlock", + "cond" + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"a\"" + ], + [ + "SwitchBlockCase", + "\"b\"" + ], + [ + "SwitchBlockCase", + "\"c\"" + ], + [ + "SwitchBlockCase", + "\"d\"" + ], + [ + "Text", + " ABCD case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + "\"z\"" + ], + [ + "Text", + " Z case " + ], + [ + "SwitchBlockCaseGroup" + ], + [ + "SwitchBlockCase", + null + ], + [ + "Text", + " No case matched " + ] ], "ignore_error": false } @@ -2314,17 +3812,57 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id) {\n {{ item }}\n } @empty {\n There were no items in the list.\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "], - ["ForLoopBlockEmpty"], - ["Text", " There were no items in the list. "] + [ + "ForLoopBlock", + "items.foo.bar", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ], + [ + "ForLoopBlockEmpty" + ], + [ + "Text", + " There were no items in the list. " + ] ], "ignore_error": false } @@ -2338,15 +3876,50 @@ "type": "ExpectFromHtml", "input": "\n @for ((item of items.foo.bar); track item.id){\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false }, @@ -2354,15 +3927,50 @@ "type": "ExpectFromHtml", "input": "\n @for ((item of items.foo.bar()); track item.id) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar()", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar()", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false }, @@ -2370,15 +3978,50 @@ "type": "ExpectFromHtml", "input": "\n @for (( ( (item of items.foo.bar()) ) ); track item.id) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar()", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar()", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false } @@ -2392,21 +4035,80 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id; let idx = $index, f = $first, c = $count; let l = $last, ev = $even, od = $odd) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["Variable", "idx", "$index"], - ["Variable", "f", "$first"], - ["Variable", "c", "$count"], - ["Variable", "l", "$last"], - ["Variable", "ev", "$even"], - ["Variable", "od", "$odd"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "Variable", + "idx", + "$index" + ], + [ + "Variable", + "f", + "$first" + ], + [ + "Variable", + "c", + "$count" + ], + [ + "Variable", + "l", + "$last" + ], + [ + "Variable", + "ev", + "$even" + ], + [ + "Variable", + "od", + "$odd" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false } @@ -2420,21 +4122,80 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id; let\nidx = $index,\nf = $first,\nc = $count,\nl = $last,\nev = $even,\nod = $odd) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["Variable", "idx", "$index"], - ["Variable", "f", "$first"], - ["Variable", "c", "$count"], - ["Variable", "l", "$last"], - ["Variable", "ev", "$even"], - ["Variable", "od", "$odd"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "Variable", + "idx", + "$index" + ], + [ + "Variable", + "f", + "$first" + ], + [ + "Variable", + "c", + "$count" + ], + [ + "Variable", + "l", + "$last" + ], + [ + "Variable", + "ev", + "$even" + ], + [ + "Variable", + "od", + "$odd" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false } @@ -2448,28 +4209,109 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id) {\n {{ item }}\n\n
    \n @for (subitem of item.items; track subitem.id) {

    {{subitem}}

    }\n
    \n } @empty {\n There were no items in the list.\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "], - ["Element", "div"], - ["ForLoopBlock", "item.items", "subitem.id"], - ["Variable", "subitem", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["Element", "h1"], - ["BoundText", "{{ subitem }}"], - ["ForLoopBlockEmpty"], - ["Text", " There were no items in the list. "] + [ + "ForLoopBlock", + "items.foo.bar", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ], + [ + "Element", + "div" + ], + [ + "ForLoopBlock", + "item.items", + "subitem.id" + ], + [ + "Variable", + "subitem", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "Element", + "h1" + ], + [ + "BoundText", + "{{ subitem }}" + ], + [ + "ForLoopBlockEmpty" + ], + [ + "Text", + " There were no items in the list. " + ] ], "ignore_error": false } @@ -2483,15 +4325,50 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track trackBy(item.id, 123)) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "items.foo.bar", "trackBy(item.id, 123)"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "items.foo.bar", + "trackBy(item.id, 123)" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false } @@ -2523,15 +4400,50 @@ "type": "ExpectFromHtml", "input": "\n @for (item of [\n { id: 1 },\n { id: 2 }\n ]; track item.id) {\n {{ item }}\n }\n ", "expected": [ - ["ForLoopBlock", "[{id: 1}, {id: 2}]", "item.id"], - ["Variable", "item", "$implicit"], - ["Variable", "$index", "$index"], - ["Variable", "$first", "$first"], - ["Variable", "$last", "$last"], - ["Variable", "$even", "$even"], - ["Variable", "$odd", "$odd"], - ["Variable", "$count", "$count"], - ["BoundText", " {{ item }} "] + [ + "ForLoopBlock", + "[{id: 1}, {id: 2}]", + "item.id" + ], + [ + "Variable", + "item", + "$implicit" + ], + [ + "Variable", + "$index", + "$index" + ], + [ + "Variable", + "$first", + "$first" + ], + [ + "Variable", + "$last", + "$last" + ], + [ + "Variable", + "$even", + "$even" + ], + [ + "Variable", + "$odd", + "$odd" + ], + [ + "Variable", + "$count", + "$count" + ], + [ + "BoundText", + " {{ item }} " + ] ], "ignore_error": false } @@ -2628,14 +4540,38 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr) {\n Extra case was true!\n } @else {\n False case!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "cond.expr"], - ["Variable", "foo", "foo"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "other.expr"], - ["Text", " Extra case was true! "], - ["IfBlockBranch", null], - ["Text", " False case! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "cond.expr" + ], + [ + "Variable", + "foo", + "foo" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "other.expr" + ], + [ + "Text", + " Extra case was true! " + ], + [ + "IfBlockBranch", + null + ], + [ + "Text", + " False case! " + ] ], "ignore_error": false } @@ -2649,13 +4585,33 @@ "type": "ExpectFromHtml", "input": "\n @if ((cond.expr)) {\n Main case was true!\n } @else if ((other.expr)) {\n Extra case was true!\n } @else {\n False case!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "(cond.expr)"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "(other.expr)"], - ["Text", " Extra case was true! "], - ["IfBlockBranch", null], - ["Text", " False case! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "(cond.expr)" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "(other.expr)" + ], + [ + "Text", + " Extra case was true! " + ], + [ + "IfBlockBranch", + null + ], + [ + "Text", + " False case! " + ] ], "ignore_error": false } @@ -2669,23 +4625,71 @@ "type": "ExpectFromHtml", "input": "\n @if (a) {\n @if (a1) {\n a1\n } @else {\n b1\n }\n }\n @else if (b) {\n b\n } @else {\n @if (c1) {\n c1\n } @else if (c2) {\n c2\n } @else {\n c3\n }\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "a"], - ["IfBlock"], - ["IfBlockBranch", "a1"], - ["Text", " a1 "], - ["IfBlockBranch", null], - ["Text", " b1 "], - ["IfBlockBranch", "b"], - ["Text", " b "], - ["IfBlockBranch", null], - ["IfBlock"], - ["IfBlockBranch", "c1"], - ["Text", " c1 "], - ["IfBlockBranch", "c2"], - ["Text", " c2 "], - ["IfBlockBranch", null], - ["Text", " c3 "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "a" + ], + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "a1" + ], + [ + "Text", + " a1 " + ], + [ + "IfBlockBranch", + null + ], + [ + "Text", + " b1 " + ], + [ + "IfBlockBranch", + "b" + ], + [ + "Text", + " b " + ], + [ + "IfBlockBranch", + null + ], + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "c1" + ], + [ + "Text", + " c1 " + ], + [ + "IfBlockBranch", + "c2" + ], + [ + "Text", + " c2 " + ], + [ + "IfBlockBranch", + null + ], + [ + "Text", + " c3 " + ] ], "ignore_error": false } @@ -2699,12 +4703,30 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr) {\n Other case was true!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "cond.expr"], - ["Variable", "foo", "foo"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "other.expr"], - ["Text", " Other case was true! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "cond.expr" + ], + [ + "Variable", + "foo", + "foo" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "other.expr" + ], + [ + "Text", + " Other case was true! " + ] ], "ignore_error": false } @@ -2718,12 +4740,30 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else\tif (other.expr) {\n Other case was true!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "cond.expr"], - ["Variable", "foo", "foo"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "other.expr"], - ["Text", " Other case was true! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "cond.expr" + ], + [ + "Variable", + "foo", + "foo" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "other.expr" + ], + [ + "Text", + " Other case was true! " + ] ], "ignore_error": false } @@ -2737,14 +4777,38 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n }\n \n @else if (other.expr) {\n Extra case was true!\n }\n \n @else {\n False case!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "cond.expr"], - ["Variable", "foo", "foo"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "other.expr"], - ["Text", " Extra case was true! "], - ["IfBlockBranch", null], - ["Text", " False case! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "cond.expr" + ], + [ + "Variable", + "foo", + "foo" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "other.expr" + ], + [ + "Text", + " Extra case was true! " + ], + [ + "IfBlockBranch", + null + ], + [ + "Text", + " False case! " + ] ], "ignore_error": false } @@ -2758,13 +4822,35 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr; as bar) {\n Other case was true!\n }\n ", "expected": [ - ["IfBlock"], - ["IfBlockBranch", "cond.expr"], - ["Variable", "foo", "foo"], - ["Text", " Main case was true! "], - ["IfBlockBranch", "other.expr"], - ["Variable", "bar", "bar"], - ["Text", " Other case was true! "] + [ + "IfBlock" + ], + [ + "IfBlockBranch", + "cond.expr" + ], + [ + "Variable", + "foo", + "foo" + ], + [ + "Text", + " Main case was true! " + ], + [ + "IfBlockBranch", + "other.expr" + ], + [ + "Variable", + "bar", + "bar" + ], + [ + "Text", + " Other case was true! " + ] ], "ignore_error": false } @@ -2783,7 +4869,13 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123 + 456;", - "expected": [["LetDeclaration", "foo", "123 + 456"]], + "expected": [ + [ + "LetDeclaration", + "foo", + "123 + 456" + ] + ], "ignore_error": false } ] @@ -2806,9 +4898,19 @@ "type": "ExpectFromHtml", "input": "
    @let foo = 123;
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "@let foo = 123;"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "@let foo = 123;" + ] ], "ignore_error": false } @@ -2949,6 +5051,97 @@ "assertions": [] } ] + }, + { + "name": "@content blocks", + "groups": [], + "tests": [ + { + "name": "should parse a valid @content block", + "path": "R3 template transform/@content blocks/should parse a valid @content block", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "\n @content(icon) {\n Icon content\n }\n ", + "expected": [ + [ + "ContentBlock", + "icon" + ], + [ + "Element", + "span" + ], + [ + "Text", + "Icon content" + ] + ], + "ignore_error": false + } + ] + }, + { + "name": "should error on invalid name", + "path": "R3 template transform/@content blocks/should error on invalid name", + "assertions": [] + }, + { + "name": "should error if @content block has missing parameter", + "path": "R3 template transform/@content blocks/should error if @content block has missing parameter", + "assertions": [] + }, + { + "name": "should error if @content block has multiple parameters", + "path": "R3 template transform/@content blocks/should error if @content block has multiple parameters", + "assertions": [] + }, + { + "name": "should parse a valid @content block with variables", + "path": "R3 template transform/@content blocks/should parse a valid @content block with variables", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "\n @content(icon; let a, b) {\n Icon content\n }\n ", + "expected": [ + [ + "ContentBlock", + "icon" + ], + [ + "Variable", + "a", + "" + ], + [ + "Variable", + "b", + "" + ], + [ + "Element", + "span" + ], + [ + "Text", + "Icon content" + ] + ], + "ignore_error": false + } + ] + }, + { + "name": "should error if a variable is assigned a value", + "path": "R3 template transform/@content blocks/should error if a variable is assigned a value", + "assertions": [] + }, + { + "name": "should error on invalid variable name", + "path": "R3 template transform/@content blocks/should error on invalid variable name", + "assertions": [] + } + ] } ], "tests": [ diff --git a/crates/angular_conformance/fixtures/render3_style_parser_spec.json b/crates/angular_conformance/fixtures/render3_style_parser_spec.json index 2eb3b8bc02..b82513b09f 100644 --- a/crates/angular_conformance/fixtures/render3_style_parser_spec.json +++ b/crates/angular_conformance/fixtures/render3_style_parser_spec.json @@ -16,7 +16,10 @@ { "type": "ParseStyle", "input": "content: \"foo\"", - "expected": ["content", "\"foo\""] + "expected": [ + "content", + "\"foo\"" + ] } ] }, @@ -27,7 +30,10 @@ { "type": "ParseStyle", "input": "width: \"1px\"", - "expected": ["width", "\"1px\""] + "expected": [ + "width", + "\"1px\"" + ] } ] } @@ -96,7 +102,14 @@ { "type": "ParseStyle", "input": "width:100px;height:200px;opacity:0", - "expected": ["width", "100px", "height", "200px", "opacity", "0"] + "expected": [ + "width", + "100px", + "height", + "200px", + "opacity", + "0" + ] } ] }, @@ -107,7 +120,12 @@ { "type": "ParseStyle", "input": "width:;height: ;", - "expected": ["width", "", "height", ""] + "expected": [ + "width", + "", + "height", + "" + ] } ] }, @@ -118,7 +136,14 @@ { "type": "ParseStyle", "input": "width :333px ; height:666px ; opacity: 0.5;", - "expected": ["width", "333px", "height", "666px", "opacity", "0.5"] + "expected": [ + "width", + "333px", + "height", + "666px", + "opacity", + "0.5" + ] } ] }, @@ -129,7 +154,12 @@ { "type": "ParseStyle", "input": "content: \"foo; man: guy\"; width: 100px", - "expected": ["content", "\"foo; man: guy\"", "width", "100px"] + "expected": [ + "content", + "\"foo; man: guy\"", + "width", + "100px" + ] } ] }, @@ -145,7 +175,10 @@ { "type": "ParseStyle", "input": "background-image: url(\"foo.jpg\")", - "expected": ["background-image", "url(\"foo.jpg\")"] + "expected": [ + "background-image", + "url(\"foo.jpg\")" + ] } ] }, @@ -156,7 +189,12 @@ { "type": "ParseStyle", "input": "color: rgba(calc(50 * 4), var(--cool), :5;); height: 100px;", - "expected": ["color", "rgba(calc(50 * 4), var(--cool), :5;)", "height", "100px"] + "expected": [ + "color", + "rgba(calc(50 * 4), var(--cool), :5;)", + "height", + "100px" + ] } ] }, @@ -167,7 +205,10 @@ { "type": "ParseStyle", "input": "borderWidth: 200px", - "expected": ["border-width", "200px"] + "expected": [ + "border-width", + "200px" + ] } ] } diff --git a/crates/angular_conformance/fixtures/render3_view_binding_spec.json b/crates/angular_conformance/fixtures/render3_view_binding_spec.json index af4060aa17..3e880c5328 100644 --- a/crates/angular_conformance/fixtures/render3_view_binding_spec.json +++ b/crates/angular_conformance/fixtures/render3_view_binding_spec.json @@ -107,6 +107,16 @@ "path": "t2 binding/extracting defer blocks info/should identify directives used after a nested defer block as being lazy", "assertions": [] }, + { + "name": "should track enclosing defer blocks for pipes", + "path": "t2 binding/extracting defer blocks info/should track enclosing defer blocks for pipes", + "assertions": [] + }, + { + "name": "should track enclosing defer blocks for element and template nodes", + "path": "t2 binding/extracting defer blocks info/should track enclosing defer blocks for element and template nodes", + "assertions": [] + }, { "name": "should identify a trigger element that is a parent of the deferred block", "path": "t2 binding/extracting defer blocks info/should identify a trigger element that is a parent of the deferred block", @@ -324,6 +334,16 @@ "name": "should not capture conflicting output bindings if they are equivalent", "path": "t2 binding/directive de-duplication/should not capture conflicting output bindings if they are equivalent", "assertions": [] + }, + { + "name": "should match foreign components by tag name", + "path": "t2 binding/directive de-duplication/should match foreign components by tag name", + "assertions": [] + }, + { + "name": "should throw an error when tag matches both directive and foreign component", + "path": "t2 binding/directive de-duplication/should throw an error when tag matches both directive and foreign component", + "assertions": [] } ] } @@ -344,6 +364,11 @@ "path": "t2 binding/should match directives on namespaced elements", "assertions": [] }, + { + "name": "should match directives on ng-template nested in namespaced elements", + "path": "t2 binding/should match directives on ng-template nested in namespaced elements", + "assertions": [] + }, { "name": "should not match directives intended for an element on a microsyntax template", "path": "t2 binding/should not match directives intended for an element on a microsyntax template", diff --git a/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json b/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json index 181ae5ba45..37ca25c078 100644 --- a/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json @@ -147,6 +147,11 @@ "path": "ShadowCss, at-rules/@import/should pass through @import directives whose URL contains colons and semicolons", "assertions": [] }, + { + "name": "should pass through @import that contains an unquoted URL with colons and semicolons", + "path": "ShadowCss, at-rules/@import/should pass through @import that contains an unquoted URL with colons and semicolons", + "assertions": [] + }, { "name": "should shim rules after @import with colons and semicolons", "path": "ShadowCss, at-rules/@import/should shim rules after @import with colons and semicolons", diff --git a/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json b/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json index 6fea6b244d..44a47fad1c 100644 --- a/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json @@ -81,6 +81,11 @@ "path": "ShadowCss, keyframes and animations/should correctly process keyframes defined without any prefixed space", "assertions": [] }, + { + "name": "should correctly process animations defined in minified rules nested in an at-rule", + "path": "ShadowCss, keyframes and animations/should correctly process animations defined in minified rules nested in an at-rule", + "assertions": [] + }, { "name": "should ignore keywords values when scoping local animations", "path": "ShadowCss, keyframes and animations/should ignore keywords values when scoping local animations", diff --git a/crates/angular_conformance/fixtures/shadow_css_nesting_spec.json b/crates/angular_conformance/fixtures/shadow_css_nesting_spec.json new file mode 100644 index 0000000000..b3a7f9176a --- /dev/null +++ b/crates/angular_conformance/fixtures/shadow_css_nesting_spec.json @@ -0,0 +1,165 @@ +{ + "name": "nesting_spec.ts", + "file_path": "crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/nesting_spec.ts", + "test_groups": [ + { + "name": "ShadowCss nesting", + "groups": [], + "tests": [ + { + "name": "should shim simple nested selector", + "path": "ShadowCss nesting/should shim simple nested selector", + "assertions": [] + }, + { + "name": "should shim nested selector with ampersand", + "path": "ShadowCss nesting/should shim nested selector with ampersand", + "assertions": [] + }, + { + "name": "should shim selector with modifier applying to ampersand", + "path": "ShadowCss nesting/should shim selector with modifier applying to ampersand", + "assertions": [] + }, + { + "name": "should shim selector with multiple ampersands", + "path": "ShadowCss nesting/should shim selector with multiple ampersands", + "assertions": [] + }, + { + "name": "should shim nested selector with multiple child selectors", + "path": "ShadowCss nesting/should shim nested selector with multiple child selectors", + "assertions": [] + }, + { + "name": "should shim nested selector followed by declarations", + "path": "ShadowCss nesting/should shim nested selector followed by declarations", + "assertions": [] + }, + { + "name": "should shim nested selector with comma-separated child selectors", + "path": "ShadowCss nesting/should shim nested selector with comma-separated child selectors", + "assertions": [] + }, + { + "name": "should shim nested selector targeting a direct descendant", + "path": "ShadowCss nesting/should shim nested selector targeting a direct descendant", + "assertions": [] + }, + { + "name": "should shim multiple levels of nested selectors", + "path": "ShadowCss nesting/should shim multiple levels of nested selectors", + "assertions": [] + }, + { + "name": "should shim selectors nested in :host", + "path": "ShadowCss nesting/should shim selectors nested in :host", + "assertions": [] + }, + { + "name": "should shim selectors nested in :host-context", + "path": "ShadowCss nesting/should shim selectors nested in :host-context", + "assertions": [] + }, + { + "name": "should shim a selector with a nested media query", + "path": "ShadowCss nesting/should shim a selector with a nested media query", + "assertions": [] + }, + { + "name": "should shim a selector with a nested media query and an ampersand", + "path": "ShadowCss nesting/should shim a selector with a nested media query and an ampersand", + "assertions": [] + }, + { + "name": "should disable encapsulation of nested selectors if the parent selector ends with ::ng-deep", + "path": "ShadowCss nesting/should disable encapsulation of nested selectors if the parent selector ends with ::ng-deep", + "assertions": [ + { + "type": "ShimCss", + "input": ".foo ::ng-deep { .bar { color: red; } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] { .bar { color: red; } }", + "normalized": true + }, + { + "type": "ShimCss", + "input": ".foo ::ng-deep { .bar { .baz { color: red; } } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] { .bar { .baz { color: red; } } }", + "normalized": true + }, + { + "type": "ShimCss", + "input": ".foo { .bar ::ng-deep { .baz { color: red; } } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] { .bar[contenta] { .baz { color: red; } } }", + "normalized": true + } + ] + }, + { + "name": "should disable encapsulation of nested selectors if the parent selector starts with ::ng-deep", + "path": "ShadowCss nesting/should disable encapsulation of nested selectors if the parent selector starts with ::ng-deep", + "assertions": [ + { + "type": "ShimCss", + "input": "::ng-deep .foo { .bar { color: red; } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo { .bar { color: red; } }", + "normalized": true + }, + { + "type": "ShimCss", + "input": "::ng-deep .foo { .bar { .baz { color: red; } } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo { .bar { .baz { color: red; } } }", + "normalized": true + }, + { + "type": "ShimCss", + "input": ".foo { ::ng-deep .bar { .baz { color: red; } } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] { .bar { .baz { color: red; } } }", + "normalized": true + } + ] + }, + { + "name": "should disable encapsulation of nested selectors if the parent selector contains ::ng-deep in the middle of the selector", + "path": "ShadowCss nesting/should disable encapsulation of nested selectors if the parent selector contains ::ng-deep in the middle of the selector", + "assertions": [ + { + "type": "ShimCss", + "input": ".foo ::ng-deep .bar { .baz { color: red; } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] .bar { .baz { color: red; } }", + "normalized": true + } + ] + }, + { + "name": "should not let a previous ::ng-deep rule affect the next one", + "path": "ShadowCss nesting/should not let a previous ::ng-deep rule affect the next one", + "assertions": [ + { + "type": "ShimCss", + "input": ".foo ::ng-deep .bar {}\n::ng-deep .baz { .qux { color: red; } }", + "content_attr": "contenta", + "host_attr": null, + "expected": ".foo[contenta] .bar {} .baz { .qux { color: red; } }", + "normalized": true + } + ] + } + ] + } + ] +} diff --git a/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json b/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json index 1d92513e86..135f240ea3 100644 --- a/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json @@ -86,6 +86,197 @@ "normalized": false } ] + }, + { + "name": "should not scope comments that are placed between a selector and its block", + "path": "ShadowCss/comments/should not scope comments that are placed between a selector and its block", + "assertions": [ + { + "type": "ShimCss", + "input": ".a /* comment */ {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta] {}", + "normalized": false + } + ] + }, + { + "name": "should not scope comments that are placed between selectors of a list", + "path": "ShadowCss/comments/should not scope comments that are placed between selectors of a list", + "assertions": [ + { + "type": "ShimCss", + "input": ".a, /* comment */ .b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta], .b[contenta] {}", + "normalized": false + }, + { + "type": "ShimCss", + "input": ".a /* comment */, .b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta] , .b[contenta] {}", + "normalized": false + } + ] + }, + { + "name": "should not scope comments that are placed between compound selectors", + "path": "ShadowCss/comments/should not scope comments that are placed between compound selectors", + "assertions": [ + { + "type": "ShimCss", + "input": ".a /* comment */ .b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta] .b[contenta] {}", + "normalized": false + }, + { + "type": "ShimCss", + "input": ".a > /* comment */ .b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta] > .b[contenta] {}", + "normalized": false + }, + { + "type": "ShimCss", + "input": ".a /* c1 */ /* c2 */ .b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta] .b[contenta] {}", + "normalized": false + } + ] + }, + { + "name": "should not scope comments inside of :host and pseudo selector functions", + "path": "ShadowCss/comments/should not scope comments inside of :host and pseudo selector functions", + "assertions": [ + { + "type": "ShimCss", + "input": ":host /* comment */ .b {}", + "content_attr": "contenta", + "host_attr": "a-host", + "expected": "[a-host] .b[contenta] {}", + "normalized": false + }, + { + "type": "ShimCss", + "input": ":is(.a, /* comment */ .b) {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ":is(.a[contenta], .b[contenta]) {}", + "normalized": false + } + ] + }, + { + "name": "should scope compound selectors that contain a comment", + "path": "ShadowCss/comments/should scope compound selectors that contain a comment", + "assertions": [ + { + "type": "ShimCss", + "input": ".a/* comment */.b {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a.b[contenta] {}", + "normalized": false + }, + { + "type": "ShimCss", + "input": ".a/* comment */:hover {}", + "content_attr": "contenta", + "host_attr": null, + "expected": ".a[contenta]:hover {}", + "normalized": false + } + ] + } + ] + }, + { + "name": "CSS variable namespacing", + "groups": [], + "tests": [ + { + "name": "should inject `%NS%` placeholder into CSS variable declarations and usages", + "path": "ShadowCss/CSS variable namespacing/should inject `%NS%` placeholder into CSS variable declarations and usages", + "assertions": [] + }, + { + "name": "should not inject `%NS%` when `--global--` prefix is present", + "path": "ShadowCss/CSS variable namespacing/should not inject `%NS%` when `--global--` prefix is present", + "assertions": [] + }, + { + "name": "should handle multiple variables with mixed namespacing", + "path": "ShadowCss/CSS variable namespacing/should handle multiple variables with mixed namespacing", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in comments", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in comments", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in strings", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in strings", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in the middle of identifiers", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in the middle of identifiers", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in attribute names", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in attribute names", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in unquoted attribute values", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in unquoted attribute values", + "assertions": [] + }, + { + "name": "should not namespace or modify CDO and CDC tokens", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify CDO and CDC tokens", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in URLs", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in URLs", + "assertions": [] + }, + { + "name": "should not namespace or modify -- in custom media queries", + "path": "ShadowCss/CSS variable namespacing/should not namespace or modify -- in custom media queries", + "assertions": [] + }, + { + "name": "should handle whitespace in variable declarations and usages", + "path": "ShadowCss/CSS variable namespacing/should handle whitespace in variable declarations and usages", + "assertions": [] + }, + { + "name": "should handle non-ascii characters", + "path": "ShadowCss/CSS variable namespacing/should handle non-ascii characters", + "assertions": [] + }, + { + "name": "should namespace @property declarations", + "path": "ShadowCss/CSS variable namespacing/should namespace @property declarations", + "assertions": [] + }, + { + "name": "should not namespace @property if --global-- is present", + "path": "ShadowCss/CSS variable namespacing/should not namespace @property if --global-- is present", + "assertions": [] } ] } diff --git a/crates/angular_conformance/fixtures/util_spec.json b/crates/angular_conformance/fixtures/util_spec.json index 55e65f022f..3f576f36c9 100644 --- a/crates/angular_conformance/fixtures/util_spec.json +++ b/crates/angular_conformance/fixtures/util_spec.json @@ -63,6 +63,48 @@ "assertions": [] } ] + }, + { + "name": "getJitStandaloneDefaultForVersion", + "groups": [], + "tests": [ + { + "name": "should return true for 0.0.0-PLACEHOLDER (starts with 0.)", + "path": "util/getJitStandaloneDefaultForVersion/should return true for 0.0.0-PLACEHOLDER (starts with 0.)", + "assertions": [] + }, + { + "name": "should return false for versions 1 through 18", + "path": "util/getJitStandaloneDefaultForVersion/should return false for versions 1 through 18", + "assertions": [] + }, + { + "name": "should return true for versions 19 and above", + "path": "util/getJitStandaloneDefaultForVersion/should return true for versions 19 and above", + "assertions": [] + } + ] + }, + { + "name": "getJitChangeDetectionDefaultForVersion", + "groups": [], + "tests": [ + { + "name": "should return OnPush for 0.0.0-PLACEHOLDER (starts with 0.)", + "path": "util/getJitChangeDetectionDefaultForVersion/should return OnPush for 0.0.0-PLACEHOLDER (starts with 0.)", + "assertions": [] + }, + { + "name": "should return Eager for versions 1 through 21", + "path": "util/getJitChangeDetectionDefaultForVersion/should return Eager for versions 1 through 21", + "assertions": [] + }, + { + "name": "should return OnPush for versions 22 and above", + "path": "util/getJitChangeDetectionDefaultForVersion/should return OnPush for versions 22 and above", + "assertions": [] + } + ] } ], "tests": [] diff --git a/crates/angular_conformance/snapshots/angular.snap.md b/crates/angular_conformance/snapshots/angular.snap.md index a627e954a0..96f3bdcdb6 100644 --- a/crates/angular_conformance/snapshots/angular.snap.md +++ b/crates/angular_conformance/snapshots/angular.snap.md @@ -6,14 +6,1886 @@ |-----------|--------|--------|--------|---------|-------|-----------| | ast_serializer | 6 | 0 | 0 | 0 | 6 | 100.0% | | ast_spans | 55 | 0 | 0 | 0 | 55 | 100.0% | -| expression_lexer | 137 | 0 | 0 | 0 | 137 | 100.0% | -| expression_parser | 270 | 0 | 0 | 0 | 270 | 100.0% | -| expression_serializer | 38 | 0 | 0 | 0 | 38 | 100.0% | -| html_lexer | 289 | 0 | 0 | 0 | 289 | 100.0% | -| html_parser | 87 | 0 | 0 | 0 | 87 | 100.0% | +| expression_lexer | 138 | 16 | 0 | 0 | 154 | 89.6% | +| expression_parser | 275 | 58 | 70 | 0 | 403 | 68.2% | +| expression_serializer | 38 | 0 | 6 | 0 | 44 | 86.4% | +| html_lexer | 291 | 6 | 0 | 0 | 297 | 98.0% | +| html_parser | 89 | 1 | 0 | 0 | 90 | 98.9% | | html_whitespace | 21 | 0 | 0 | 0 | 21 | 100.0% | -| r3_transform | 177 | 0 | 0 | 0 | 177 | 100.0% | -| shadow_css | 169 | 0 | 0 | 0 | 169 | 100.0% | +| r3_transform | 179 | 5 | 0 | 0 | 184 | 97.3% | +| shadow_css | 185 | 2 | 0 | 0 | 187 | 98.9% | | style_parser | 15 | 0 | 0 | 0 | 15 | 100.0% | -| **Total** | **1264** | **0** | **0** | **0** | **1264** | **100.0%** | +| **Total** | **1292** | **88** | **76** | **0** | **1456** | **88.7%** | + +## Failed Tests + +### expression_lexer + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "++", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("++")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "--", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("--")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "a++", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("++")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "a--", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("--")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "++a", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("++")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators: ExpressionLexerTest { input: "--a", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("--")) }] } +Path: `lexer/token/should tokenize increment/decrement operators` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators used together with plus/minus: ExpressionLexerTest { input: "+++a", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 2, end: 3, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 2, start: 3, end: 4, value: Some(String("a")) }] } +Path: `lexer/token/should tokenize increment/decrement operators used together with plus/minus` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators used together with plus/minus: ExpressionLexerTest { input: "---a", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("--")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 2, end: 3, value: Some(String("-")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 2, start: 3, end: 4, value: Some(String("a")) }] } +Path: `lexer/token/should tokenize increment/decrement operators used together with plus/minus` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators used together with plus/minus: ExpressionLexerTest { input: "-- foo++", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 2, value: Some(String("--")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 1, start: 3, end: 6, value: Some(String("foo")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 6, end: 8, value: Some(String("++")) }] } +Path: `lexer/token/should tokenize increment/decrement operators used together with plus/minus` + +**Expected:** +``` +Token type Operator at index 0 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators used together with plus/minus: ExpressionLexerTest { input: "- - foo++", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Operator, token_index: 0, start: 0, end: 1, value: Some(String("-")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 2, end: 3, value: Some(String("-")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 2, start: 4, end: 7, value: Some(String("foo")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 3, start: 7, end: 9, value: Some(String("++")) }] } +Path: `lexer/token/should tokenize increment/decrement operators used together with plus/minus` + +**Expected:** +``` +Token type Operator at index 3 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a+++b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 3, end: 4, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 3, start: 4, end: 5, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a+++++b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 3, end: 5, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 3, start: 5, end: 6, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 4, start: 6, end: 7, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a-----b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("--")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 3, end: 5, value: Some(String("--")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 3, start: 5, end: 6, value: Some(String("-")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 4, start: 6, end: 7, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a+++ +b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 3, end: 4, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 3, start: 5, end: 6, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 4, start: 6, end: 7, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a+--b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 2, value: Some(String("+")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 2, end: 4, value: Some(String("--")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 3, start: 4, end: 5, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 2 +``` + +**Actual:** +``` +Token type Error +``` + +#### should tokenize increment/decrement operators followed by other operators in an expression: ExpressionLexerTest { input: "a+++=b", expected_token_count: None, token_assertions: [ExpressionTokenAssertion { assertion_type: Identifier, token_index: 0, start: 0, end: 1, value: Some(String("a")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 1, start: 1, end: 3, value: Some(String("++")) }, ExpressionTokenAssertion { assertion_type: Operator, token_index: 2, start: 3, end: 5, value: Some(String("+=")) }, ExpressionTokenAssertion { assertion_type: Identifier, token_index: 3, start: 5, end: 6, value: Some(String("b")) }] } +Path: `lexer/token/should tokenize increment/decrement operators followed by other operators in an expression` + +**Expected:** +``` +Token type Operator at index 1 +``` + +**Actual:** +``` +Token type Error +``` + +### expression_parser + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "a++ ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "++a ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "a-- ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 2 in [a-- ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "--a ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--a ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "a.b++ ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [a.b++ ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "a[0]++ ** 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 5 in [a[0]++ ** 2]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "2 ** a++", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [2 ** a++]"] +``` + +#### should allow ++ and -- on the left-hand side of **: CheckAction { input: "a ** b++ ** c", expected: None } +Path: `parser/parseAction/should allow ++ and -- on the left-hand side of **` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [a ** b++ ** c]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++a", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--a", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--a]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++a.b", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a.b]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--a.b", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--a.b]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++a[0]", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a[0]]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--a[0]", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--a[0]]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++this.a", expected: Some("++a") } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++this.a]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--this.a", expected: Some("--a") } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--this.a]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++a!", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a!]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--a!", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--a!]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "++(a)", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++(a)]"] +``` + +#### should parse prefix ++ and --: CheckAction { input: "--(a)", expected: None } +Path: `parser/parseAction/should parse prefix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--(a)]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a++", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a--", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 2 in [a--]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a.b++", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [a.b++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a.b--", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [a.b--]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a[0]++", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 5 in [a[0]++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a[0]--", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 5 in [a[0]--]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "this.a++", expected: Some("a++") } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [this.a++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "this.a--", expected: Some("a--") } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 7 in [this.a--]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a!++", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 3 in [a!++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "a!--", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 3 in [a!--]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "(a)++", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [(a)++]"] +``` + +#### should parse postfix ++ and --: CheckAction { input: "(a)--", expected: None } +Path: `parser/parseAction/should parse postfix ++ and --` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [(a)--]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "- - foo++", expected: Some("- -foo++") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 8 in [- - foo++]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "+ + foo++", expected: Some("+ +foo++") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 8 in [+ + foo++]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "- ++foo", expected: Some("-++foo") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 3 in [- ++foo]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "+ --foo", expected: Some("+--foo") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 3 in [+ --foo]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a+++b", expected: Some("a++ + b") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a+++b]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a---b", expected: Some("a-- - b") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 2 in [a---b]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a+++b+++c", expected: Some("a++ + b++ + c") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "++ is not allowed", "++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a+++b+++c]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a+++ +b", expected: Some("a++ + +b") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a+++ +b]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a+ ++b", expected: Some("a + ++b") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [a+ ++b]"] +``` + +#### should parse consecutive unary expressions: CheckAction { input: "a- --b", expected: Some("a - --b") } +Path: `parser/parseAction/should parse consecutive unary expressions` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [a- --b]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "-a++", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 3 in [-a++]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "+a++", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 3 in [+a++]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "!a++", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 3 in [!a++]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "-a--", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 3 in [-a--]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "typeof a++", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 9 in [typeof a++]"] +``` + +#### should bind ++ and -- tighter than the other unary operators: CheckAction { input: "void a++", expected: None } +Path: `parser/parseAction/should bind ++ and -- tighter than the other unary operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [void a++]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ instanceof b", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ instanceof b]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ in o", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ in o]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ < 3", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ < 3]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ * 2", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ * 2]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ ?? b", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ ?? b]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a ? b++ : c--", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "-- is not allowed", "Conditional expression a ? b requires all 3 expressions at column 6"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "o[a++]", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Missing expected ] at column 4"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "f(a++)", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Missing expected ) at column 4"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "[a++]", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Missing expected ] at column 3"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "{x: a++}", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Missing expected } at column 6"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "c = a++", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 6 in [c = a++]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "c += a++", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [c += a++]"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a.b[c++].d++", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "++ is not allowed", "Missing expected ] at column 6"] +``` + +#### should allow ++ and -- expressions as operands of other operators: CheckAction { input: "a++ + ++a", expected: None } +Path: `parser/parseAction/should allow ++ and -- expressions as operands of other operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ + ++a]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "-- foo++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "++ is not allowed", "Unexpected token -- is not allowed at column 1 in [-- foo++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++ foo--", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "-- is not allowed", "Unexpected token ++ is not allowed at column 1 in [++ foo--]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "a?.a++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 5 in [a?.a++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++a?.a", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a?.a]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "a?.[0]++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [a?.[0]++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++a?.[0]", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a?.[0]]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "5++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [5++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++5", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++5]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "foo()++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 6 in [foo()++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++foo()", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++foo()]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "---foo", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 1 in [---foo]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "+++foo", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [+++foo]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "(foo++)++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Missing closing parentheses at column 5", "Unexpected token ++ is not allowed at column 8 in [(foo++)++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++(foo++)", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++(foo++)]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++foo++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++foo++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "--foo--", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--foo--]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++foo--", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "-- is not allowed", "Unexpected token ++ is not allowed at column 1 in [++foo--]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "--foo++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "++ is not allowed", "Unexpected token -- is not allowed at column 1 in [--foo++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++ ++foo", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++ ++foo]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "-- --foo", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 1 in [-- --foo]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++foo+++bar", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++foo+++bar]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "(-foo)++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [(-foo)++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "(foo + bar)++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 12 in [(foo + bar)++]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "++(foo + bar)", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++(foo + bar)]"] +``` + +#### should report invalid increment/decrement expressions: ExpectActionError { input: "\"foo\"++", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should report invalid increment/decrement expressions` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 6 in [\"foo\"++]"] +``` + +#### should report unexpected token for chained postfix operators: ExpectActionError { input: "foo++ ++", error_contains: "Unexpected token '++'" } +Path: `parser/parseAction/assignment/should report unexpected token for chained postfix operators` + +**Expected:** +``` +Error containing: Unexpected token '++' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo++ ++]"] +``` + +#### should report unexpected token for chained postfix operators: ExpectActionError { input: "foo-- --", error_contains: "Unexpected token '--'" } +Path: `parser/parseAction/assignment/should report unexpected token for chained postfix operators` + +**Expected:** +``` +Error containing: Unexpected token '--' +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 4 in [foo-- --]"] +``` + +#### should report unexpected token for chained postfix operators: ExpectActionError { input: "foo+++++bar", error_contains: "Unexpected token '++'" } +Path: `parser/parseAction/assignment/should report unexpected token for chained postfix operators` + +**Expected:** +``` +Error containing: Unexpected token '++' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo+++++bar]"] +``` + +#### should report unexpected token for chained postfix operators: ExpectActionError { input: "foo-----bar", error_contains: "Unexpected token '--'" } +Path: `parser/parseAction/assignment/should report unexpected token for chained postfix operators` + +**Expected:** +``` +Error containing: Unexpected token '--' +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 4 in [foo-----bar]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "a+++", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a+++]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "a---", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "-- is not allowed", "Unexpected token -- is not allowed at column 2 in [a---]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "a++ +", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++ +]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "a++-", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a++-]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "++a+", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++a+]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "a+++b+", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [a+++b+]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "foo.bar+++", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 8 in [foo.bar+++]"] +``` + +#### should report a dangling + or - left over after an update operator: ExpectActionError { input: "foo[0]+++", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a dangling + or - left over after an update operator` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 7 in [foo[0]+++]"] +``` + +#### should report a increment/decrement expression with no target: ExpectActionError { input: "++", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a increment/decrement expression with no target` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++]"] +``` + +#### should report a increment/decrement expression with no target: ExpectActionError { input: "--", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a increment/decrement expression with no target` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 1 in [--]"] +``` + +#### should report a increment/decrement expression with no target: ExpectActionError { input: "+++", error_contains: "Unexpected end of expression" } +Path: `parser/parseAction/assignment/should report a increment/decrement expression with no target` + +**Expected:** +``` +Error containing: Unexpected end of expression +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [+++]"] +``` + +#### should not allow member access or calls after a postfix update: ExpectActionError { input: "foo++.bar", error_contains: "Unexpected token '.'" } +Path: `parser/parseAction/assignment/should not allow member access or calls after a postfix update` + +**Expected:** +``` +Error containing: Unexpected token '.' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo++.bar]"] +``` + +#### should not allow member access or calls after a postfix update: ExpectActionError { input: "foo++[0]", error_contains: "Unexpected token '['" } +Path: `parser/parseAction/assignment/should not allow member access or calls after a postfix update` + +**Expected:** +``` +Error containing: Unexpected token '[' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo++[0]]"] +``` + +#### should not allow member access or calls after a postfix update: ExpectActionError { input: "foo++()", error_contains: "Unexpected token '('" } +Path: `parser/parseAction/assignment/should not allow member access or calls after a postfix update` + +**Expected:** +``` +Error containing: Unexpected token '(' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo++()]"] +``` + +#### should not allow member access or calls after a postfix update: ExpectActionError { input: "foo--.bar", error_contains: "Unexpected token '.'" } +Path: `parser/parseAction/assignment/should not allow member access or calls after a postfix update` + +**Expected:** +``` +Error containing: Unexpected token '.' +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [foo--.bar]"] +``` + +#### should not allow member access or calls after a postfix update: ExpectActionError { input: "foo-- bar", error_contains: "Unexpected token 'bar'" } +Path: `parser/parseAction/assignment/should not allow member access or calls after a postfix update` + +**Expected:** +``` +Error containing: Unexpected token 'bar' +``` + +**Actual:** +``` +Errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [foo-- bar]"] +``` + +#### should not allow assigning to an update expression: ExpectActionError { input: "foo++ = 1", error_contains: "Unexpected token '='" } +Path: `parser/parseAction/assignment/should not allow assigning to an update expression` + +**Expected:** +``` +Error containing: Unexpected token '=' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo++ = 1]"] +``` + +#### should not allow assigning to an update expression: ExpectActionError { input: "++foo = 1", error_contains: "cannot be used in the assignment" } +Path: `parser/parseAction/assignment/should not allow assigning to an update expression` + +**Expected:** +``` +Error containing: cannot be used in the assignment +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 1 in [++foo = 1]"] +``` + +#### should not allow assigning to an update expression: ExpectActionError { input: "foo+++=bar", error_contains: "Unexpected token '+='" } +Path: `parser/parseAction/assignment/should not allow assigning to an update expression` + +**Expected:** +``` +Error containing: Unexpected token '+=' +``` + +**Actual:** +``` +Errors: ["++ is not allowed", "++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [foo+++=bar]"] +``` + +#### should report error if interpolation is empty: CheckBinding { input: "`hello ${}`", expected: None } +Path: `parser/parseAction/template literals/should report error if interpolation is empty` + +**Error:** +``` +Unexpected parse errors: ["Template literal interpolation cannot be empty"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "`hello ${a b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token 'b' at column 12 in [`hello ${a b} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "`hello ${a & b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token '&' at column 12 in [`hello ${a & b} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "`hello ${a, b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token ',' at column 11 in [`hello ${a, b} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "`hello ${`nested ${a b}`} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token 'b' at column 22 in [`hello ${`nested ${a b}`} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "tag`hello ${a b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token 'b' at column 15 in [tag`hello ${a b} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectBindingError { input: "`hello ${a | pipe b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token 'b' at column 19 in [`hello ${a | pipe b} world`]"] +``` + +#### should report an error if an interpolation has unexpected tokens after the expression: ExpectActionError { input: "`hello ${a; b} world`", error_contains: "Missing expected }" } +Path: `parser/parseAction/template literals/should report an error if an interpolation has unexpected tokens after the expression` + +**Expected:** +``` +Error containing: Missing expected } +``` + +**Actual:** +``` +Errors: ["Unexpected token } at column 14 in [`hello ${a; b} world`]"] +``` + +#### should report an error if an interpolation is not closed: ExpectBindingError { input: "`hello ${a", error_contains: "Missing expected } at the end of the expression" } +Path: `parser/parseAction/template literals/should report an error if an interpolation is not closed` + +**Expected:** +``` +Error containing: Missing expected } at the end of the expression +``` + +**Actual:** +``` +No errors +``` + +#### should report an error if an interpolation is not closed: ExpectBindingError { input: "`hello ${a ", error_contains: "Missing expected } at the end of the expression" } +Path: `parser/parseAction/template literals/should report an error if an interpolation is not closed` + +**Expected:** +``` +Error containing: Missing expected } at the end of the expression +``` + +**Actual:** +``` +No errors +``` + +#### should report an error if a template literal with an interpolation is not closed: ExpectBindingError { input: "`hello ${a}", error_contains: "Unterminated template literal" } +Path: `parser/parseAction/template literals/should report an error if a template literal with an interpolation is not closed` + +**Expected:** +``` +Error containing: Unterminated template literal +``` + +**Actual:** +``` +No errors +``` + +#### should parse a regular expression literal that ends with an escaped slash: CheckBinding { input: "/^https?:\\/\\//", expected: None } +Path: `parser/parseAction/regular expression literals/should parse a regular expression literal that ends with an escaped slash` + +**Error:** +``` +Unexpected parse errors: ["Lexer Error: Unterminated regular expression at column 12 in expression [/^https?:\\/\\]", "Unexpected token 'Lexer Error: Unterminated regular expression at column 12 in expression [/^https?:\\/\\]' at column 13 in [/^https?:\\/\\//]"] +``` + +#### should parse a regular expression literal that ends with an escaped slash: CheckBinding { input: "url.replace(/^\\//, \"\") //comment", expected: Some("url.replace(/^\\//, \"\")") } +Path: `parser/parseAction/regular expression literals/should parse a regular expression literal that ends with an escaped slash` + +**Error:** +``` +Unexpected parse errors: ["Lexer Error: Unterminated regular expression at column 15 in expression [url.replace(/^\\]", "Missing expected ) at column 16"] +``` + +#### should parse an arrow function containing update operators: CheckBinding { input: "a => a++", expected: None } +Path: `parser/parseBinding/arrow functions/should parse an arrow function containing update operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token '++ is not allowed' at column 7 in [a => a++]"] +``` + +#### should parse an arrow function containing update operators: CheckBinding { input: "a => a--", expected: None } +Path: `parser/parseBinding/arrow functions/should parse an arrow function containing update operators` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token '-- is not allowed' at column 7 in [a => a--]"] +``` + +#### should parse an arrow function containing update operators: CheckBinding { input: "a => ++a", expected: None } +Path: `parser/parseBinding/arrow functions/should parse an arrow function containing update operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token '++ is not allowed' at column 6 in [a => ++a]"] +``` + +#### should parse an arrow function containing update operators: CheckBinding { input: "a => --a", expected: None } +Path: `parser/parseBinding/arrow functions/should parse an arrow function containing update operators` + +**Error:** +``` +Unexpected parse errors: ["-- is not allowed", "Unexpected token '-- is not allowed' at column 6 in [a => --a]"] +``` + +#### should parse an arrow function containing update operators: CheckBinding { input: "(a) => a++", expected: Some("a => a++") } +Path: `parser/parseBinding/arrow functions/should parse an arrow function containing update operators` + +**Error:** +``` +Unexpected parse errors: ["++ is not allowed", "Unexpected token '++ is not allowed' at column 9 in [(a) => a++]"] +``` + +### expression_serializer + +#### should serialize prefix increment and decrement: SerializeExpression { input: " ++ foo ", expected: "++foo" } +Path: `serializer/serialize/should serialize prefix increment and decrement` + +**Error:** +``` +Parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 2 in [ ++ foo ]"] +``` + +#### should serialize prefix increment and decrement: SerializeExpression { input: " -- foo ", expected: "--foo" } +Path: `serializer/serialize/should serialize prefix increment and decrement` + +**Error:** +``` +Parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 2 in [ -- foo ]"] +``` + +#### should serialize postfix increment and decrement: SerializeExpression { input: " foo ++ ", expected: "foo++" } +Path: `serializer/serialize/should serialize postfix increment and decrement` + +**Error:** +``` +Parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 6 in [ foo ++ ]"] +``` + +#### should serialize postfix increment and decrement: SerializeExpression { input: " foo -- ", expected: "foo--" } +Path: `serializer/serialize/should serialize postfix increment and decrement` + +**Error:** +``` +Parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 6 in [ foo -- ]"] +``` + +#### should separate unary operators next to each other: SerializeExpression { input: " + ++foo ", expected: "+ ++foo" } +Path: `serializer/serialize/should separate unary operators next to each other` + +**Error:** +``` +Parse errors: ["++ is not allowed", "Unexpected token ++ is not allowed at column 4 in [ + ++foo ]"] +``` + +#### should separate unary operators next to each other: SerializeExpression { input: " - --foo ", expected: "- --foo" } +Path: `serializer/serialize/should separate unary operators next to each other` + +**Error:** +``` +Parse errors: ["-- is not allowed", "Unexpected token -- is not allowed at column 4 in [ - --foo ]"] +``` + +### html_lexer + +#### should parse a processing instruction: HtmlLexerTest { input: "", test_type: HumanizeParts, expected: [Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"1.0\" encoding=\"UTF-8\"")], Array [String("TokenType.EOF")]], options: None } +Path: `HtmlLexer/processing instructions/should parse a processing instruction` + +**Expected:** +``` +Token 0: Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"1.0\" encoding=\"UTF-8\"")] +``` + +**Actual:** +``` +Token 0: Array [String("TokenType.TEXT"), String("")] +``` + +#### should parse a processing instruction ending with > instead of ?>: HtmlLexerTest { input: "", test_type: HumanizeParts, expected: [Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"1.0\" encoding=\"UTF-8\"")], Array [String("TokenType.EOF")]], options: None } +Path: `HtmlLexer/processing instructions/should parse a processing instruction ending with > instead of ?>` + +**Expected:** +``` +Token 0: Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"1.0\" encoding=\"UTF-8\"")] +``` + +**Actual:** +``` +Token 0: Array [String("TokenType.TEXT"), String("")] +``` + +#### should parse a processing instruction surrounded by other content: HtmlLexerTest { input: "\n hello", test_type: HumanizeParts, expected: [Array [String("TokenType.DOC_TYPE"), String("DOCTYPE html")], Array [String("TokenType.TEXT"), String("\n")], Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"1.0\" encoding=\"UTF-8\"")], Array [String("TokenType.TEXT"), String(" hello")], Array [String("TokenType.EOF")]], options: None } +Path: `HtmlLexer/processing instructions/should parse a processing instruction surrounded by other content` + +**Expected:** +``` +5 tokens +``` + +**Actual:** +``` +3 tokens: [Array [String("TokenType.DOC_TYPE"), String("DOCTYPE html")], Array [String("TokenType.TEXT"), String("\n hello")], Array [String("TokenType.EOF")]] +``` + +#### should parse a processing instruction that contains question marks inside quoted content: HtmlLexerTest { input: "-8\"?>", test_type: HumanizeParts, expected: [Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"?\" encoding=\"UTF?>-8\"")], Array [String("TokenType.EOF")]], options: None } +Path: `HtmlLexer/processing instructions/should parse a processing instruction that contains question marks inside quoted content` + +**Expected:** +``` +Token 0: Array [String("TokenType.PROCESSING_INSTRUCTION"), String("xml version=\"?\" encoding=\"UTF?>-8\"")] +``` + +**Actual:** +``` +Token 0: Array [String("TokenType.TEXT"), String("-8\"?>")] +``` + +#### should store the location of a processing instruction: HtmlLexerTest { input: "", test_type: HumanizeSourceSpans, expected: [Array [String("TokenType.PROCESSING_INSTRUCTION"), String("")], Array [String("TokenType.EOF"), String("")]], options: None } +Path: `HtmlLexer/processing instructions/should store the location of a processing instruction` + +**Expected:** +``` +Token 0: Array [String("TokenType.PROCESSING_INSTRUCTION"), String("")] +``` + +**Actual:** +``` +Token 0: Array [String("TokenType.TEXT"), String("")] +``` + +#### should report missing end of a processing instruction: HtmlLexerTest { input: "hello", expected: [Array [String("html.Text"), String("hello"), Number(0.0), Array [String("hello")]]] } +Path: `HtmlParser/parse/ignored syntax/should ignore processing instruction` + +**Expected:** +``` +[Array [String("html.Text"), String("hello"), Number(0.0), Array [String("hello")]]] +``` + +**Actual:** +``` +[Array [String("html.Text"), String("hello"), Number(0), Array [String("hello")]]] +``` + +### r3_transform + +#### should parse @boundary blocks with multiple @error blocks: ExpectFromHtml { input: "\n @boundary {\n
    Content
    \n } @error (when err instanceof SpecificError) {\n
    Specific Error
    \n } @error (let err) {\n
    General Error {{ err }}
    \n }\n ", expected: [Array [String("BoundaryBlock")], Array [String("Element"), String("div")], Array [String("Text"), String("Content")], Array [String("BoundaryErrorBlock"), String("err instanceof SpecificError")], Array [String("Variable"), String("$error"), String("$error")], Array [String("Variable"), String("$reset"), String("$reset")], Array [String("Element"), String("div")], Array [String("Text"), String("Specific Error")], Array [String("BoundaryErrorBlock"), Null], Array [String("Variable"), String("$error"), String("$error")], Array [String("Variable"), String("$reset"), String("$reset")], Array [String("Variable"), String("err"), String("$error")], Array [String("Element"), String("div")], Array [String("BoundText"), String("General Error {{ err }}")]], ignore_error: false } +Path: `R3 template transform/Boundary blocks/should parse @boundary blocks with multiple @error blocks` + +**Expected:** +``` +[BoundaryBlock] +[Element, div] +[Text, Content] +[BoundaryErrorBlock, err instanceof SpecificError] +[Variable, $error, $error] +[Variable, $reset, $reset] +[Element, div] +[Text, Specific Error] +[BoundaryErrorBlock, null] +[Variable, $error, $error] +[Variable, $reset, $reset] +[Variable, err, $error] +[Element, div] +[BoundText, General Error {{ err }}] +``` + +**Actual:** +``` + +``` + +**Diff:** +```diff +-[BoundaryBlock] +-[Element, div] +-[Text, Content] +-[BoundaryErrorBlock, err instanceof SpecificError] +-[Variable, $error, $error] +-[Variable, $reset, $reset] +-[Element, div] +-[Text, Specific Error] +-[BoundaryErrorBlock, null] +-[Variable, $error, $error] +-[Variable, $reset, $reset] +-[Variable, err, $error] +-[Element, div] +-[BoundText, General Error {{ err }}] + +``` + +#### should ignore safe", expected: [Array [String("Element"), String(":xhtml:div")], Array [String("TextAttribute"), String(":xmlns:xhtml"), String("http://www.w3.org/1999/xhtml")], Array [String("Element"), String(":xhtml:span")], Array [String("Text"), String("safe")]], ignore_error: false } +Path: `R3 template transform/safe", expected: [Array [String("Element"), String(":foo:div")], Array [String("TextAttribute"), String("ngNonBindable"), String("")], Array [String("Element"), String(":foo:span")], Array [String("Text"), String("safe")]], ignore_error: false } +Path: `R3 template transform/ngNonBindable/should ignore custom-namespaced safe", expected: [Array [String("Element"), String(":xhtml:div")], Array [String("TextAttribute"), String(":xmlns:xhtml"), String("http://www.w3.org/1999/xhtml")], Array [String("Element"), String(":xhtml:span")], Array [String("Text"), String("safe")]], ignore_error: false } Path: `R3 template transform/", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "abc\ndef\nghi\tjkl`'\"mno" - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -3057,26 +1907,11 @@ "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "abc\ndef\nghi\tjkl`'\"mno" - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -3098,51 +1933,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "c" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "d" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "c"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", "d"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -3203,17 +2004,9 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "test" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "test"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -3228,17 +2021,9 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "ns1", - "test" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "ns1", "test"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -3253,17 +2038,9 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "test" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "test"], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null } @@ -3278,17 +2055,9 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "test" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "test"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -3303,18 +2072,9 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.EOF", ""] ], "options": null } @@ -3335,20 +2095,10 @@ "input": "@let foo = 123 + 456;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123 + 456" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "123 + 456"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3452,20 +2202,10 @@ "input": "@let foo = \n123 + \n 456 + \n789\n;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123 + \n 456 + \n789\n" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "123 + \n 456 + \n789\n"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3480,30 +2220,13 @@ "input": "@defer {@let foo = 123 + 456;}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "defer" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123 + 456" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "defer"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "123 + 456"], + ["TokenType.LET_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -3518,20 +2241,10 @@ "input": "@let foo = 'a; b';", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "'a; b'" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "'a; b'"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3540,20 +2253,10 @@ "input": "@let foo = \"';'\";", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "\"';'\"" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "\"';'\""], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3578,20 +2281,10 @@ "input": "@let foo = [1, 2, 3];", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "[1, 2, 3]" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "[1, 2, 3]"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3600,20 +2293,10 @@ "input": "@let foo = [0, [foo[1]], 3];", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "[0, [foo[1]], 3]" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "[0, [foo[1]], 3]"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3628,20 +2311,10 @@ "input": "@let foo = {a: 1, b: {c: something + 2}};", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "{a: 1, b: {c: something + 2}}" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "{a: 1, b: {c: something + 2}}"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3650,20 +2323,10 @@ "input": "@let foo = {};", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "{}" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "{}"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3672,20 +2335,10 @@ "input": "@let foo = {foo: \";\"};", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "{foo: \";\"}" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "{foo: \";\"}"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3704,12 +2357,7 @@ "type": "HtmlLexerTest", "input": "@let foo = \";", "test_type": "HumanizeErrors", - "expected": [ - [ - "Unexpected character \"EOF\"", - "0:13" - ] - ], + "expected": [["Unexpected character \"EOF\"", "0:13"]], "options": null }, { @@ -3717,20 +2365,10 @@ "input": "@let foo = {a: 1,;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "{a: 1," - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "{a: 1,"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3739,20 +2377,10 @@ "input": "@let foo = [1, ;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "[1, " - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "[1, "], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3761,20 +2389,10 @@ "input": "@let foo = fn(;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "fn(" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", "fn("], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3789,20 +2407,10 @@ "input": "@let foo =;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "foo" - ], - [ - "TokenType.LET_VALUE", - "" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "foo"], + ["TokenType.LET_VALUE", ""], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null } @@ -3817,17 +2425,9 @@ "input": "@letFoo = 123;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "@let" - ], - [ - "TokenType.TEXT", - "Foo = 123;" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "@let"], + ["TokenType.TEXT", "Foo = 123;"], + ["TokenType.EOF"] ], "options": null } @@ -3842,17 +2442,9 @@ "input": "@let foo\\bar = 123;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "foo" - ], - [ - "TokenType.TEXT", - "\\bar = 123;" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "foo"], + ["TokenType.TEXT", "\\bar = 123;"], + ["TokenType.EOF"] ], "options": null }, @@ -3861,17 +2453,9 @@ "input": "@let #foo = 123;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "" - ], - [ - "TokenType.TEXT", - "#foo = 123;" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", ""], + ["TokenType.TEXT", "#foo = 123;"], + ["TokenType.EOF"] ], "options": null }, @@ -3880,17 +2464,9 @@ "input": "@let foo\nbar = 123;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "foo" - ], - [ - "TokenType.TEXT", - "bar = 123;" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "foo"], + ["TokenType.TEXT", "bar = 123;"], + ["TokenType.EOF"] ], "options": null } @@ -3905,20 +2481,10 @@ "input": "@let a123 = foo;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.LET_START", - "a123" - ], - [ - "TokenType.LET_VALUE", - "foo" - ], - [ - "TokenType.LET_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.LET_START", "a123"], + ["TokenType.LET_VALUE", "foo"], + ["TokenType.LET_END"], + ["TokenType.EOF"] ], "options": null }, @@ -3927,17 +2493,9 @@ "input": "@let 123a = 123;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "" - ], - [ - "TokenType.TEXT", - "123a = 123;" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", ""], + ["TokenType.TEXT", "123a = 123;"], + ["TokenType.EOF"] ], "options": null } @@ -3952,17 +2510,9 @@ "input": "@let foo = 123 + 456", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123 + 456" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "foo"], + ["TokenType.LET_VALUE", "123 + 456"], + ["TokenType.EOF"] ], "options": null }, @@ -3971,17 +2521,9 @@ "input": "@let foo = 123 + 456 ", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123 + 456 " - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "foo"], + ["TokenType.LET_VALUE", "123 + 456 "], + ["TokenType.EOF"] ], "options": null }, @@ -3990,17 +2532,9 @@ "input": "@let foo = 123, bar = 456", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_LET", - "foo" - ], - [ - "TokenType.LET_VALUE", - "123, bar = 456" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_LET", "foo"], + ["TokenType.LET_VALUE", "123, bar = 456"], + ["TokenType.EOF"] ], "options": null } @@ -4015,23 +2549,10 @@ "input": "{{ @let foo = 123; }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " @let foo = 123; ", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " @let foo = 123; ", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.EOF"] ], "options": null } @@ -4052,22 +2573,10 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4082,98 +2591,27 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - "v", - "}}" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "s" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - "m", - "}}" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "e" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "c" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "s" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - "m//c", - "}}" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "e" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "v", "}}"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "s"], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "m", "}}"], + ["TokenType.ATTR_VALUE_TEXT", "e"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "c"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "s"], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "m//c", "}}"], + ["TokenType.ATTR_VALUE_TEXT", "e"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4188,43 +2626,15 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - " a \\\" ' b " - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", " a \\\" ' b "], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null }, @@ -4233,43 +2643,15 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - " a \" \\' b " - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", " a \" \\' b "], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4284,22 +2666,10 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "ns1", - "a" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "ns1", "a"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4314,22 +2684,10 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "(ns1:a)" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "(ns1:a)"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4344,34 +2702,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4386,34 +2723,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4428,26 +2744,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4462,36 +2763,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "a" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_VALUE_INTERPOLATION", - "{{", - "link.text", - "}}" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "a"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_VALUE_INTERPOLATION", "{{", "link.text", "}}"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4506,34 +2784,16 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "app-component" - ], - [ - "TokenType.ATTR_NAME", - "", - "[attr]" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], + ["TokenType.TAG_OPEN_START", "", "app-component"], + ["TokenType.ATTR_NAME", "", "[attr]"], + ["TokenType.ATTR_QUOTE", "\""], [ "TokenType.ATTR_VALUE_TEXT", "[\n {text: 'some text',url:'//www.google.com'},\n {text:'other text',url:'//www.google.com'}]" ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4548,34 +2808,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4590,26 +2829,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4624,52 +2848,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ENCODED_ENTITY", - "A", - "A" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ENCODED_ENTITY", - "A", - "A" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ENCODED_ENTITY", "A", "A"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ENCODED_ENTITY", "A", "A"], + ["TokenType.ATTR_VALUE_TEXT", ""], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4683,52 +2872,18 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "&" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "c&&d" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + "expected": [ + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "&"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "c&&d"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4743,34 +2898,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b && c &" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "b && c &"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4785,34 +2919,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "t\ne\ns\nt" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", "t\ne\ns\nt"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": null } @@ -4827,26 +2940,11 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.EOF", ""] ], "options": null } @@ -4860,12 +2958,7 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.data-[size='large']:p-8]" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "expr" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.data-[size='large']:p-8]"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "expr"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null }, @@ -5005,22 +3030,10 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.data-[size='large']:p-8]" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.data-[size='large']:p-8]"], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null }, @@ -5029,34 +3042,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.data-[size='hello white space']]" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "expr" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.data-[size='hello white space']]"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "expr"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null } @@ -5071,34 +3063,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.a]b]c]" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "expr" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.a]b]c]"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "expr"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null }, @@ -5107,22 +3078,10 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.a[]][[]]b]][c]" - ], - [ - "TokenType.TAG_OPEN_END_VOID" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.a[]][[]]b]][c]"], + ["TokenType.TAG_OPEN_END_VOID"], + ["TokenType.EOF"] ], "options": null } @@ -5137,28 +3096,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "", - "foo" - ], - [ - "TokenType.ATTR_NAME", - "", - "[class.text-" - ], - [ - "TokenType.ATTR_NAME", - "", - "primary" - ], - [ - "TokenType.TEXT", - "80]=\"expr\"/>" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_TAG_OPEN", "", "foo"], + ["TokenType.ATTR_NAME", "", "[class.text-"], + ["TokenType.ATTR_NAME", "", "primary"], + ["TokenType.TEXT", "80]=\"expr\"/>"], + ["TokenType.EOF"] ], "options": null } @@ -5178,16 +3120,7 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TAG_CLOSE", - "", - "test" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], "options": null } ] @@ -5200,16 +3133,7 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TAG_CLOSE", - "ns1", - "test" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TAG_CLOSE", "ns1", "test"], ["TokenType.EOF"]], "options": null } ] @@ -5222,16 +3146,7 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TAG_CLOSE", - "", - "test" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], "options": null } ] @@ -5245,14 +3160,8 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_CLOSE", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_CLOSE", ""], + ["TokenType.EOF", ""] ], "options": null } @@ -5266,12 +3175,7 @@ "type": "HtmlLexerTest", "input": "a", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.TEXT", - "a" - ], - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.TEXT", "a"], + ["TokenType.INCOMPLETE_TAG_OPEN", ""], + ["TokenType.EOF", ""] ], "options": null }, @@ -6013,15 +3621,7 @@ "type": "HtmlLexerTest", "input": "< a>", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "< a>" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "< a>"], ["TokenType.EOF"]], "options": null } ] @@ -6035,50 +3635,17 @@ "input": "{{ a d }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " a " - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.TAG_OPEN_START", - "", - "b" - ], - [ - "TokenType.ATTR_NAME", - "", - "&&" - ], - [ - "TokenType.ATTR_NAME", - "", - "c" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - " d " - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " a "], + ["TokenType.TEXT", ""], + ["TokenType.TAG_OPEN_START", "", "b"], + ["TokenType.ATTR_NAME", "", "&&"], + ["TokenType.ATTR_NAME", "", "c"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", " d "], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -6093,35 +3660,14 @@ "input": "{{ a }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " a }" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.COMMENT_START" - ], - [ - "TokenType.RAW_TEXT", - "" - ], - [ - "TokenType.COMMENT_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " a }"], + ["TokenType.TEXT", ""], + ["TokenType.COMMENT_START"], + ["TokenType.RAW_TEXT", ""], + ["TokenType.COMMENT_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -6136,35 +3682,13 @@ "input": "

    {{ a

    ", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "p" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " a " - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.TAG_CLOSE", - "", - "p" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "p"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " a "], + ["TokenType.TEXT", ""], + ["TokenType.TAG_CLOSE", "", "p"], + ["TokenType.EOF"] ], "options": null } @@ -6179,35 +3703,14 @@ "input": "{{ a }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " a }" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.CDATA_START" - ], - [ - "TokenType.RAW_TEXT", - "" - ], - [ - "TokenType.CDATA_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " a }"], + ["TokenType.TEXT", ""], + ["TokenType.CDATA_START"], + ["TokenType.RAW_TEXT", ""], + ["TokenType.CDATA_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -6222,36 +3725,13 @@ "input": "{{'<={'}}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "code" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - "'<={'", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.TAG_CLOSE", - "", - "code" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "code"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", "'<={'", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.TAG_CLOSE", "", "code"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -6273,18 +3753,9 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "", - "t" - ], - [ - "TokenType.TEXT", - "\">" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], + ["TokenType.TEXT", "\">"], + ["TokenType.EOF"] ], "options": null }, @@ -6293,61 +3764,30 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "", - "t" - ], - [ - "TokenType.TEXT", - "'>" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], + ["TokenType.TEXT", "'>"], + ["TokenType.EOF"] ], "options": null - } - ] - }, - { - "name": "should parse start tags quotes in place of an attribute name (after a valid attribute)", - "path": "HtmlLexer/regular text/should parse start tags quotes in place of an attribute name (after a valid attribute)", - "assertions": [ - { - "type": "HtmlLexerTest", - "input": "", - "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TEXT", - "\">" - ], - [ - "TokenType.EOF" - ] + } + ] + }, + { + "name": "should parse start tags quotes in place of an attribute name (after a valid attribute)", + "path": "HtmlLexer/regular text/should parse start tags quotes in place of an attribute name (after a valid attribute)", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "", + "test_type": "HumanizeParts", + "expected": [ + ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TEXT", "\">"], + ["TokenType.EOF"] ], "options": null }, @@ -6356,35 +3796,13 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_TAG_OPEN", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TEXT", - "'>" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_TAG_OPEN", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TEXT", "'>"], + ["TokenType.EOF"] ], "options": null } @@ -6399,23 +3817,10 @@ "input": "{{ \"{\" }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " \"{\" ", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " \"{\" ", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.EOF"] ], "options": null } @@ -6430,23 +3835,10 @@ "input": "{{ \"{{\" }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " \"{{\" ", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " \"{{\" ", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.EOF"] ], "options": null } @@ -6461,22 +3853,10 @@ "input": "{{ \"{{a}}' }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - " \"{{a}}' }}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", " \"{{a}}' }}"], + ["TokenType.TEXT", ""], + ["TokenType.EOF"] ], "options": null } @@ -6491,26 +3871,11 @@ "input": "{a, b, =4 {c}}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "span" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "{a, b, =4 {c}}" - ], - [ - "TokenType.TAG_CLOSE", - "", - "span" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "span"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", "{a, b, =4 {c}}"], + ["TokenType.TAG_CLOSE", "", "span"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -6538,26 +3903,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "t\ne\ns\nt" - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "t\ne\ns\nt"], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": null } @@ -6572,26 +3922,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "&" - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "&"], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": null } @@ -6606,26 +3941,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "a
    " - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "a
    "], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": null } @@ -6640,26 +3960,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "a" - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "a"], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": null } @@ -6674,26 +3979,11 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.RAW_TEXT", - "a" - ], - [ - "TokenType.TAG_CLOSE", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.RAW_TEXT", "a"], + ["TokenType.TAG_CLOSE", ""], + ["TokenType.EOF", ""] ], "options": null } @@ -6714,26 +4004,11 @@ "input": "t\ne\rs\r\nt", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "t\ne\ns\nt" - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", "t\ne\ns\nt"], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": null } @@ -6748,35 +4023,13 @@ "input": "&", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "" - ], - [ - "TokenType.ENCODED_ENTITY", - "&", - "&" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "" - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", ""], + ["TokenType.ENCODED_ENTITY", "&", "&"], + ["TokenType.ESCAPABLE_RAW_TEXT", ""], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": null } @@ -6791,26 +4044,11 @@ "input": "a<div>", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "a
    " - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", "a
    "], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": null } @@ -6825,26 +4063,11 @@ "input": "a</test>", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "a" - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", "a"], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": null } @@ -6859,26 +4082,11 @@ "input": "a", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "a" - ], - [ - "TokenType.TAG_CLOSE", - "" - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.ESCAPABLE_RAW_TEXT", "a"], + ["TokenType.TAG_CLOSE", ""], + ["TokenType.EOF", ""] ], "options": null } @@ -6899,26 +4107,11 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "svg", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "test" - ], - [ - "TokenType.TAG_CLOSE", - "svg", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "svg", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", "test"], + ["TokenType.TAG_CLOSE", "svg", "title"], + ["TokenType.EOF"] ], "options": null } @@ -6933,39 +4126,14 @@ "input": "test", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "svg", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TAG_OPEN_START", - "", - "f" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "test" - ], - [ - "TokenType.TAG_CLOSE", - "", - "f" - ], - [ - "TokenType.TAG_CLOSE", - "svg", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "svg", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TAG_OPEN_START", "", "f"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", "test"], + ["TokenType.TAG_CLOSE", "", "f"], + ["TokenType.TAG_CLOSE", "svg", "title"], + ["TokenType.EOF"] ], "options": null } @@ -7004,96 +4172,54 @@ "name": "{escapedString: false}", "groups": [], "tests": [ - { - "name": "should normalize line-endings in expansion forms if `i18nNormalizeLineEndingsInICUs` is true", - "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should normalize line-endings in expansion forms if `i18nNormalizeLineEndingsInICUs` is true", - "assertions": [] - }, - { - "name": "should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapeString: false)", - "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapeString: false)", - "assertions": [] - }, - { - "name": "should not normalize line endings in nested expansion forms when `i18nNormalizeLineEndingsInICUs` is not defined", - "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line endings in nested expansion forms when `i18nNormalizeLineEndingsInICUs` is not defined", - "assertions": [] - } - ] - } - ], - "tests": [] - } - ], - "tests": [ - { - "name": "should parse an expansion form", - "path": "HtmlLexer/expansion forms/should parse an expansion form", - "assertions": [ - { - "type": "HtmlLexerTest", - "input": "{one.two, three, =4 {four} =5 {five} foo {bar} }", - "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "one.two" - ], - [ - "TokenType.RAW_TEXT", - "three" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "four" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=5" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "five" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "foo" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "bar" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.EOF" - ] + { + "name": "should normalize line-endings in expansion forms if `i18nNormalizeLineEndingsInICUs` is true", + "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should normalize line-endings in expansion forms if `i18nNormalizeLineEndingsInICUs` is true", + "assertions": [] + }, + { + "name": "should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapeString: false)", + "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapeString: false)", + "assertions": [] + }, + { + "name": "should not normalize line endings in nested expansion forms when `i18nNormalizeLineEndingsInICUs` is not defined", + "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line endings in nested expansion forms when `i18nNormalizeLineEndingsInICUs` is not defined", + "assertions": [] + } + ] + } + ], + "tests": [] + } + ], + "tests": [ + { + "name": "should parse an expansion form", + "path": "HtmlLexer/expansion forms/should parse an expansion form", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "{one.two, three, =4 {four} =5 {five} foo {bar} }", + "test_type": "HumanizeParts", + "expected": [ + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "one.two"], + ["TokenType.RAW_TEXT", "three"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "four"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_CASE_VALUE", "=5"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "five"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_CASE_VALUE", "foo"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "bar"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7115,45 +4241,17 @@ "input": "before{one.two, three, =4 {four}}after", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "before" - ], - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "one.two" - ], - [ - "TokenType.RAW_TEXT", - "three" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "four" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.TEXT", - "after" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "before"], + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "one.two"], + ["TokenType.RAW_TEXT", "three"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "four"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.TEXT", "after"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7175,63 +4273,21 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "div" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TAG_OPEN_START", - "", - "span" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "a" - ], - [ - "TokenType.RAW_TEXT", - "b" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "c" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.TAG_CLOSE", - "", - "span" - ], - [ - "TokenType.TAG_CLOSE", - "", - "div" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "div"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TAG_OPEN_START", "", "span"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "a"], + ["TokenType.RAW_TEXT", "b"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "c"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.TAG_CLOSE", "", "span"], + ["TokenType.TAG_CLOSE", "", "div"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7253,71 +4309,23 @@ "input": "
    {a, b, =4 {c}}
    ", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "div" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TAG_OPEN_START", - "", - "span" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - " " - ], - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "a" - ], - [ - "TokenType.RAW_TEXT", - "b" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "c" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.TEXT", - " " - ], - [ - "TokenType.TAG_CLOSE", - "", - "span" - ], - [ - "TokenType.TAG_CLOSE", - "", - "div" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "div"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TAG_OPEN_START", "", "span"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", " "], + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "a"], + ["TokenType.RAW_TEXT", "b"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "c"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.TEXT", " "], + ["TokenType.TAG_CLOSE", "", "span"], + ["TokenType.TAG_CLOSE", "", "div"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7339,54 +4347,19 @@ "input": "{one.two, three, =4 {four a}}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "one.two" - ], - [ - "TokenType.RAW_TEXT", - "three" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "four " - ], - [ - "TokenType.TAG_OPEN_START", - "", - "b" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "a" - ], - [ - "TokenType.TAG_CLOSE", - "", - "b" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "one.two"], + ["TokenType.RAW_TEXT", "three"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "four "], + ["TokenType.TAG_OPEN_START", "", "b"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", "a"], + ["TokenType.TAG_CLOSE", "", "b"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7408,47 +4381,17 @@ "input": "{one.two, three, =4 {four {{a}}}}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "one.two" - ], - [ - "TokenType.RAW_TEXT", - "three" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "four " - ], - [ - "TokenType.INTERPOLATION", - "{{", - "a", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "one.two"], + ["TokenType.RAW_TEXT", "three"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "four "], + ["TokenType.INTERPOLATION", "{{", "a", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7470,65 +4413,23 @@ "input": "{one.two, three, =4 { {xx, yy, =x {one}} }}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "one.two" - ], - [ - "TokenType.RAW_TEXT", - "three" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=4" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.EXPANSION_FORM_START" - ], - [ - "TokenType.RAW_TEXT", - "xx" - ], - [ - "TokenType.RAW_TEXT", - "yy" - ], - [ - "TokenType.EXPANSION_CASE_VALUE", - "=x" - ], - [ - "TokenType.EXPANSION_CASE_EXP_START" - ], - [ - "TokenType.TEXT", - "one" - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.TEXT", - " " - ], - [ - "TokenType.EXPANSION_CASE_EXP_END" - ], - [ - "TokenType.EXPANSION_FORM_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "one.two"], + ["TokenType.RAW_TEXT", "three"], + ["TokenType.EXPANSION_CASE_VALUE", "=4"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.EXPANSION_FORM_START"], + ["TokenType.RAW_TEXT", "xx"], + ["TokenType.RAW_TEXT", "yy"], + ["TokenType.EXPANSION_CASE_VALUE", "=x"], + ["TokenType.EXPANSION_CASE_EXP_START"], + ["TokenType.TEXT", "one"], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.TEXT", " "], + ["TokenType.EXPANSION_CASE_EXP_END"], + ["TokenType.EXPANSION_FORM_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": true, @@ -7617,26 +4518,11 @@ "input": "

    İ

    ", "test_type": "HumanizeSourceSpans", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "" - ], - [ - "TokenType.TEXT", - "İ" - ], - [ - "TokenType.TAG_CLOSE", - "

    " - ], - [ - "TokenType.EOF", - "" - ] + ["TokenType.TAG_OPEN_START", ""], + ["TokenType.TEXT", "İ"], + ["TokenType.TAG_CLOSE", "

    "], + ["TokenType.EOF", ""] ], "options": null } @@ -7656,15 +4542,7 @@ "type": "HtmlLexerTest", "input": "\\' \\' \\'", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "' ' '" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "' ' '"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7678,15 +4556,7 @@ "type": "HtmlLexerTest", "input": "\\\" \\\" \\\"", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\" \" \"" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\" \" \""], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7700,15 +4570,7 @@ "type": "HtmlLexerTest", "input": "\\` \\` \\`", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "` ` `" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "` ` `"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7722,15 +4584,7 @@ "type": "HtmlLexerTest", "input": "\\\\ \\\\ \\\\", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\\ \\ \\" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\\ \\ \\"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7744,15 +4598,7 @@ "type": "HtmlLexerTest", "input": "\\n \\n \\n", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\n \n \n" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\n \n \n"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7767,23 +4613,10 @@ "input": "\\r{{\\r}}\\r", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "\n" - ], - [ - "TokenType.INTERPOLATION", - "{{", - "\n", - "}}" - ], - [ - "TokenType.TEXT", - "\n" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "\n"], + ["TokenType.INTERPOLATION", "{{", "\n", "}}"], + ["TokenType.TEXT", "\n"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -7795,18 +4628,10 @@ } }, { - "type": "HtmlLexerTest", - "input": "\\v \\v \\v", - "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\u000b \u000b \u000b" - ], - [ - "TokenType.EOF" - ] - ], + "type": "HtmlLexerTest", + "input": "\\v \\v \\v", + "test_type": "HumanizeParts", + "expected": [["TokenType.TEXT", "\u000b \u000b \u000b"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7820,15 +4645,7 @@ "type": "HtmlLexerTest", "input": "\\t \\t \\t", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\t \t \t" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\t \t \t"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7842,15 +4659,7 @@ "type": "HtmlLexerTest", "input": "\\b \\b \\b", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\b \b \b" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\b \b \b"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7864,15 +4673,7 @@ "type": "HtmlLexerTest", "input": "\\f \\f \\f", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\f \f \f" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\f \f \f"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7887,13 +4688,8 @@ "input": "\\' \\\" \\` \\\\ \\n \\r \\v \\t \\b \\f", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "' \" ` \\ \n \n \u000b \t \b \f" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "' \" ` \\ \n \n \u000b \t \b \f"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -7914,11 +4710,7 @@ "type": "HtmlLexerTest", "input": "\\0", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7932,11 +4724,7 @@ "type": "HtmlLexerTest", "input": "\\09", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -7957,13 +4745,8 @@ "input": "\\001 \\01 \\1 \\12 \\223 \\19 \\2234 \\999", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "\u0001 \u0001 \u0001 \n “ \u00019 “4 999" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "\u0001 \u0001 \u0001 \n “ \u00019 “4 999"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -7984,15 +4767,7 @@ "type": "HtmlLexerTest", "input": "\\x12 \\x4F \\xDC", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\u0012 O Ü" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\u0012 O Ü"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8012,12 +4787,7 @@ "type": "HtmlLexerTest", "input": "\\xGG", "test_type": "HumanizeErrors", - "expected": [ - [ - "Invalid hexadecimal escape sequence", - "0:2" - ] - ], + "expected": [["Invalid hexadecimal escape sequence", "0:2"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8031,12 +4801,7 @@ "type": "HtmlLexerTest", "input": "abc \\x xyz", "test_type": "HumanizeErrors", - "expected": [ - [ - "Invalid hexadecimal escape sequence", - "0:6" - ] - ], + "expected": [["Invalid hexadecimal escape sequence", "0:6"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8050,12 +4815,7 @@ "type": "HtmlLexerTest", "input": "abc\\x", "test_type": "HumanizeErrors", - "expected": [ - [ - "Unexpected character \"EOF\"", - "0:5" - ] - ], + "expected": [["Unexpected character \"EOF\"", "0:5"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8075,15 +4835,7 @@ "type": "HtmlLexerTest", "input": "\\u0123 \\uABCD", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "ģ ꯍ" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "ģ ꯍ"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8103,12 +4855,7 @@ "type": "HtmlLexerTest", "input": "\\uGGGG", "test_type": "HumanizeErrors", - "expected": [ - [ - "Invalid hexadecimal escape sequence", - "0:2" - ] - ], + "expected": [["Invalid hexadecimal escape sequence", "0:2"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8128,15 +4875,7 @@ "type": "HtmlLexerTest", "input": "\\u{01} \\u{ABC} \\u{1234} \\u{123AB}", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "\u0001 ઼ ሴ 𒎫" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "\u0001 ઼ ሴ 𒎫"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8156,12 +4895,7 @@ "type": "HtmlLexerTest", "input": "\\u{GG}", "test_type": "HumanizeErrors", - "expected": [ - [ - "Invalid hexadecimal escape sequence", - "0:3" - ] - ], + "expected": [["Invalid hexadecimal escape sequence", "0:3"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8181,15 +4915,7 @@ "type": "HtmlLexerTest", "input": "abc\\\ndef", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "abcdef" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "abcdef"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8203,15 +4929,7 @@ "type": "HtmlLexerTest", "input": "\\\nx\\\ny\\\n", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "xy" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "xy"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8231,15 +4949,7 @@ "type": "HtmlLexerTest", "input": "a g ~", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "a g ~" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "a g ~"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8259,15 +4969,7 @@ "type": "HtmlLexerTest", "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "abc\ndef\nghi\tjkl`'\"mno" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "abc\ndef\nghi\tjkl`'\"mno"], ["TokenType.EOF"]], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -8288,26 +4990,11 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "script" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.RAW_TEXT", - "abc\ndef\nghi\tjkl`'\"mno" - ], - [ - "TokenType.TAG_CLOSE", - "", - "script" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "script"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], + ["TokenType.TAG_CLOSE", "", "script"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -8329,26 +5016,11 @@ "input": "abc\ndef\\nghi\\tjkl\\`\\'\\\"mno", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "title" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.ESCAPABLE_RAW_TEXT", - "abc\ndef\nghi\tjkl`'\"mno" - ], - [ - "TokenType.TAG_CLOSE", - "", - "title" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "title"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.ESCAPABLE_RAW_TEXT", "abc\ndef\nghi\tjkl`'\"mno"], + ["TokenType.TAG_CLOSE", "", "title"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -8370,51 +5042,17 @@ "input": "", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "t" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "c" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "d" - ], - [ - "TokenType.ATTR_QUOTE", - "'" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "t"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "c"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.ATTR_VALUE_TEXT", "d"], + ["TokenType.ATTR_QUOTE", "'"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.EOF"] ], "options": { "tokenize_expansion_forms": false, @@ -8504,19 +5142,10 @@ "input": "@default never;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "default never" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "default never"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null }, @@ -8525,19 +5154,10 @@ "input": "@default never;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "default never" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "default never"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8552,23 +5172,11 @@ "input": "@default never(expr);", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "default never" - ], - [ - "TokenType.BLOCK_PARAMETER", - "expr" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "default never"], + ["TokenType.BLOCK_PARAMETER", "expr"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8583,19 +5191,10 @@ "input": "@default never ;", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "default never" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "default never"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8610,31 +5209,13 @@ "input": "@for (item of items; track item.id) {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "for" - ], - [ - "TokenType.BLOCK_PARAMETER", - "item of items" - ], - [ - "TokenType.BLOCK_PARAMETER", - "track item.id" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "for"], + ["TokenType.BLOCK_PARAMETER", "item of items"], + ["TokenType.BLOCK_PARAMETER", "track item.id"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8649,27 +5230,12 @@ "input": "@for (item of items;) {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "for" - ], - [ - "TokenType.BLOCK_PARAMETER", - "item of items" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "for"], + ["TokenType.BLOCK_PARAMETER", "item of items"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8684,23 +5250,11 @@ "input": "@else if {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "else if" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "else if"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null }, @@ -8709,27 +5263,12 @@ "input": "@else if (foo !== 2) {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "else if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "foo !== 2" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "else if"], + ["TokenType.BLOCK_PARAMETER", "foo !== 2"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8744,23 +5283,11 @@ "input": "@else if {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "else if" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "else if"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8801,35 +5328,20 @@ ] }, { - "name": "should parse a block with multiple trailing semicolons", - "path": "HtmlLexer/blocks/should parse a block with multiple trailing semicolons", - "assertions": [ - { - "type": "HtmlLexerTest", - "input": "@for (item of items;;;;;) {hello}", - "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "for" - ], - [ - "TokenType.BLOCK_PARAMETER", - "item of items" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + "name": "should parse a block with multiple trailing semicolons", + "path": "HtmlLexer/blocks/should parse a block with multiple trailing semicolons", + "assertions": [ + { + "type": "HtmlLexerTest", + "input": "@for (item of items;;;;;) {hello}", + "test_type": "HumanizeParts", + "expected": [ + ["TokenType.BLOCK_OPEN_START", "for"], + ["TokenType.BLOCK_PARAMETER", "item of items"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8844,23 +5356,11 @@ "input": "@defer {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "defer" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "defer"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8875,27 +5375,12 @@ "input": "@for (item of items){hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "for" - ], - [ - "TokenType.BLOCK_PARAMETER", - "item of items" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "for"], + ["TokenType.BLOCK_PARAMETER", "item of items"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8915,31 +5400,13 @@ "input": "@defer (on a({a: 1, b: 2}, false, {c: 3}); when b({d: 4})) {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "defer" - ], - [ - "TokenType.BLOCK_PARAMETER", - "on a({a: 1, b: 2}, false, {c: 3})" - ], - [ - "TokenType.BLOCK_PARAMETER", - "when b({d: 4})" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "defer"], + ["TokenType.BLOCK_PARAMETER", "on a({a: 1, b: 2}, false, {c: 3})"], + ["TokenType.BLOCK_PARAMETER", "when b({d: 4})"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -8954,17 +5421,9 @@ "input": "@if (a === b {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "a === b {hello}" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], + ["TokenType.BLOCK_PARAMETER", "a === b {hello}"], + ["TokenType.EOF"] ], "options": null } @@ -8979,20 +5438,10 @@ "input": "@if a === b) {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "if a" - ], - [ - "TokenType.TEXT", - "=== b) {hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_BLOCK_OPEN", "if a"], + ["TokenType.TEXT", "=== b) {hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9006,24 +5455,14 @@ "type": "HtmlLexerTest", "input": "@if (a === \") {hello}", "test_type": "HumanizeErrors", - "expected": [ - [ - "Unexpected character \"EOF\"", - "0:21" - ] - ], + "expected": [["Unexpected character \"EOF\"", "0:21"]], "options": null }, { "type": "HtmlLexerTest", "input": "@if (a === \"hi') {hello}", "test_type": "HumanizeErrors", - "expected": [ - [ - "Unexpected character \"EOF\"", - "0:24" - ] - ], + "expected": [["Unexpected character \"EOF\"", "0:24"]], "options": null } ] @@ -9037,24 +5476,11 @@ "input": "@if ({invalid: true) hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "{invalid: true" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], + ["TokenType.BLOCK_PARAMETER", "{invalid: true"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9069,27 +5495,12 @@ "input": "@if (condition === \"';'\") {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "condition === \"';'\"" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "if"], + ["TokenType.BLOCK_PARAMETER", "condition === \"';'\""], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9104,27 +5515,12 @@ "input": "@if (condition === \"\\\";\") {hello}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "condition === \"\\\";\"" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "hello" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "if"], + ["TokenType.BLOCK_PARAMETER", "condition === \"\\\";\""], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "hello"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9139,48 +5535,17 @@ "input": "@if (a === 1) {foo bar baz}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "a === 1" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "foo " - ], - [ - "TokenType.TAG_OPEN_START", - "", - "b" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TEXT", - "bar" - ], - [ - "TokenType.TAG_CLOSE", - "", - "b" - ], - [ - "TokenType.TEXT", - " baz" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "if"], + ["TokenType.BLOCK_PARAMETER", "a === 1"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", "foo "], + ["TokenType.TAG_OPEN_START", "", "b"], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TEXT", "bar"], + ["TokenType.TAG_CLOSE", "", "b"], + ["TokenType.TEXT", " baz"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9195,70 +5560,22 @@ "input": "@if (a === 1) {
    }", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "a === 1" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TAG_OPEN_START", - "", - "div" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "}" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_NAME", - "", - "b" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "{" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TAG_CLOSE", - "", - "div" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "if"], + ["TokenType.BLOCK_PARAMETER", "a === 1"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TAG_OPEN_START", "", "div"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "}"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_NAME", "", "b"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "{"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TAG_CLOSE", "", "div"], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9273,39 +5590,14 @@ "input": "
    ", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TAG_OPEN_START", - "", - "div" - ], - [ - "TokenType.ATTR_NAME", - "", - "a" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.ATTR_VALUE_TEXT", - "@if (foo) {}" - ], - [ - "TokenType.ATTR_QUOTE", - "\"" - ], - [ - "TokenType.TAG_OPEN_END" - ], - [ - "TokenType.TAG_CLOSE", - "", - "div" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TAG_OPEN_START", "", "div"], + ["TokenType.ATTR_NAME", "", "a"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.ATTR_VALUE_TEXT", "@if (foo) {}"], + ["TokenType.ATTR_QUOTE", "\""], + ["TokenType.TAG_OPEN_END"], + ["TokenType.TAG_CLOSE", "", "div"], + ["TokenType.EOF"] ], "options": null } @@ -9330,33 +5622,13 @@ "input": "@defer {{{message}}}", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.BLOCK_OPEN_START", - "defer" - ], - [ - "TokenType.BLOCK_OPEN_END" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.INTERPOLATION", - "{{", - "message", - "}}" - ], - [ - "TokenType.TEXT", - "" - ], - [ - "TokenType.BLOCK_CLOSE" - ], - [ - "TokenType.EOF" - ] + ["TokenType.BLOCK_OPEN_START", "defer"], + ["TokenType.BLOCK_OPEN_END"], + ["TokenType.TEXT", ""], + ["TokenType.INTERPOLATION", "{{", "message", "}}"], + ["TokenType.TEXT", ""], + ["TokenType.BLOCK_CLOSE"], + ["TokenType.EOF"] ], "options": null } @@ -9371,21 +5643,10 @@ "input": "My email frodo@for.com", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "My email frodo" - ], - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "for" - ], - [ - "TokenType.TEXT", - ".com" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "My email frodo"], + ["TokenType.INCOMPLETE_BLOCK_OPEN", "for"], + ["TokenType.TEXT", ".com"], + ["TokenType.EOF"] ], "options": null } @@ -9400,17 +5661,9 @@ "input": "My favorite console is @switch", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "My favorite console is " - ], - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "switch" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "My favorite console is "], + ["TokenType.INCOMPLETE_BLOCK_OPEN", "switch"], + ["TokenType.EOF"] ], "options": null } @@ -9425,21 +5678,10 @@ "input": "Use the @for() block", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "Use the " - ], - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "for" - ], - [ - "TokenType.TEXT", - "block" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "Use the "], + ["TokenType.INCOMPLETE_BLOCK_OPEN", "for"], + ["TokenType.TEXT", "block"], + ["TokenType.EOF"] ], "options": null } @@ -9454,25 +5696,11 @@ "input": "This is the @if({alias: \"foo\"}) expression", "test_type": "HumanizeParts", "expected": [ - [ - "TokenType.TEXT", - "This is the " - ], - [ - "TokenType.INCOMPLETE_BLOCK_OPEN", - "if" - ], - [ - "TokenType.BLOCK_PARAMETER", - "{alias: \"foo\"}" - ], - [ - "TokenType.TEXT", - "expression" - ], - [ - "TokenType.EOF" - ] + ["TokenType.TEXT", "This is the "], + ["TokenType.INCOMPLETE_BLOCK_OPEN", "if"], + ["TokenType.BLOCK_PARAMETER", "{alias: \"foo\"}"], + ["TokenType.TEXT", "expression"], + ["TokenType.EOF"] ], "options": null } @@ -9486,15 +5714,7 @@ "type": "HtmlLexerTest", "input": "@", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "@" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "@"], ["TokenType.EOF"]], "options": null } ] @@ -9507,15 +5727,7 @@ "type": "HtmlLexerTest", "input": " @", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - " @" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", " @"], ["TokenType.EOF"]], "options": null } ] @@ -9528,15 +5740,7 @@ "type": "HtmlLexerTest", "input": "@ ", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "@ " - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "@ "], ["TokenType.EOF"]], "options": null } ] @@ -9549,15 +5753,7 @@ "type": "HtmlLexerTest", "input": "@\nfoo", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "@\nfoo" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "@\nfoo"], ["TokenType.EOF"]], "options": null } ] @@ -9570,15 +5766,7 @@ "type": "HtmlLexerTest", "input": "foo bar @ baz clink", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "foo bar @ baz clink" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "foo bar @ baz clink"], ["TokenType.EOF"]], "options": null } ] @@ -9591,15 +5779,7 @@ "type": "HtmlLexerTest", "input": "@ if", "test_type": "HumanizeParts", - "expected": [ - [ - "TokenType.TEXT", - "@ if" - ], - [ - "TokenType.EOF" - ] - ], + "expected": [["TokenType.TEXT", "@ if"], ["TokenType.EOF"]], "options": null } ] diff --git a/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json b/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json index 468364526a..e55dbaee97 100644 --- a/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_ast_absolute_span_spec.json @@ -16,11 +16,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [ - [ - "1 + 2" - ] - ], + "expected": [["1 + 2"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -37,14 +33,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [ - [ - "1" - ], - [ - "2" - ] - ], + "expected": [["1"], ["2"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -67,11 +56,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{bool ? 1 : 0}}
    ", - "expected": [ - [ - "bool ? 1 : 0" - ] - ], + "expected": [["bool ? 1 : 0"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -88,17 +73,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{bool ? 1 : 0}}
    ", - "expected": [ - [ - "bool" - ], - [ - "1" - ], - [ - "0" - ] - ], + "expected": [["bool"], ["1"], ["0"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -121,11 +96,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "a(); b();" - ] - ], + "expected": [["a(); b();"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -142,14 +113,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "a()" - ], - [ - "b()" - ] - ], + "expected": [["a()"], ["b()"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -172,11 +136,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{fn()()}}
    ", - "expected": [ - [ - "fn()()" - ] - ], + "expected": [["fn()()"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -193,11 +153,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{fn()(param)}}
    ", - "expected": [ - [ - "param" - ] - ], + "expected": [["param"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -220,11 +176,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + foo.length}}
    ", - "expected": [ - [ - "{{ 1 + foo.length }}" - ] - ], + "expected": [["{{ 1 + foo.length }}"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -241,14 +193,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{1 + 2}}
    ", - "expected": [ - [ - "1" - ], - [ - "2" - ] - ], + "expected": [["1"], ["2"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -265,11 +210,7 @@ { "type": "HumanizeExpressionSource", "input": " {{abc}}", - "expected": [ - [ - "abc" - ] - ], + "expected": [["abc"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -286,17 +227,7 @@ { "type": "HumanizeExpressionSource", "input": ""{{abc}}"{{def}} {{ghi}}", - "expected": [ - [ - "abc" - ], - [ - "def" - ], - [ - "ghi" - ] - ], + "expected": [["abc"], ["def"], ["ghi"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -313,11 +244,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "abc" - ] - ], + "expected": [["abc"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -334,11 +261,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "abc" - ] - ], + "expected": [["abc"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -355,14 +278,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "abc" - ], - [ - "def" - ] - ], + "expected": [["abc"], ["def"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -385,11 +301,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key]}}
    ", - "expected": [ - [ - "obj[key]" - ] - ], + "expected": [["obj[key]"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -406,11 +318,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key]}}
    ", - "expected": [ - [ - "key" - ] - ], + "expected": [["key"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -433,11 +341,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key] = 0}}
    ", - "expected": [ - [ - "obj[key] = 0" - ] - ], + "expected": [["obj[key] = 0"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -454,14 +358,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{obj[key] = 0}}
    ", - "expected": [ - [ - "key" - ], - [ - "0" - ] - ], + "expected": [["key"], ["0"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -484,11 +381,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{[0, 1, 2]}}
    ", - "expected": [ - [ - "[0, 1, 2]" - ] - ], + "expected": [["[0, 1, 2]"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -505,17 +398,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{[0, 1, 2]}}
    ", - "expected": [ - [ - "0" - ], - [ - "1" - ], - [ - "2" - ] - ], + "expected": [["0"], ["1"], ["2"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -538,11 +421,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{ {a: 0} }}
    ", - "expected": [ - [ - "{a: 0}" - ] - ], + "expected": [["{a: 0}"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -559,11 +438,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{ {a: 0} }}
    ", - "expected": [ - [ - "0" - ] - ], + "expected": [["0"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -586,11 +461,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{method()}}
    ", - "expected": [ - [ - "method()" - ] - ], + "expected": [["method()"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -607,11 +478,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{method(param)}}
    ", - "expected": [ - [ - "param" - ] - ], + "expected": [["param"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -634,11 +501,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop!}}
    ", - "expected": [ - [ - "prop!" - ] - ], + "expected": [["prop!"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -655,11 +518,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop!}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -682,11 +541,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop | pipe}}
    ", - "expected": [ - [ - "(prop | pipe)" - ] - ], + "expected": [["(prop | pipe)"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -703,11 +558,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop | pipe}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -730,11 +581,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop.obj}}
    ", - "expected": [ - [ - "prop.obj" - ] - ], + "expected": [["prop.obj"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -751,11 +598,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop.obj}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -778,11 +621,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "prop = 0" - ] - ], + "expected": [["prop = 0"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -799,11 +638,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "prop.inner = 0" - ] - ], + "expected": [["prop.inner = 0"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -820,11 +655,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "0" - ] - ], + "expected": [["0"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -847,11 +678,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{!prop}}
    ", - "expected": [ - [ - "!prop" - ] - ], + "expected": [["!prop"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -868,11 +695,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{!prop}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -895,11 +718,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe()}}
    ", - "expected": [ - [ - "prop?.safe()" - ] - ], + "expected": [["prop?.safe()"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -916,11 +735,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe()}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -943,11 +758,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe}}
    ", - "expected": [ - [ - "prop?.safe" - ] - ], + "expected": [["prop?.safe"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -964,11 +775,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{prop?.safe}}
    ", - "expected": [ - [ - "prop" - ] - ], + "expected": [["prop"]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": false, @@ -991,11 +798,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{item}}
    ", - "expected": [ - [ - "items" - ] - ], + "expected": [["items"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1012,14 +815,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "As" - ], - [ - "Bs" - ] - ], + "expected": [["As"], ["Bs"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1067,11 +863,7 @@ { "type": "HumanizeExpressionSource", "input": "{{foo // comment}}", - "expected": [ - [ - "foo" - ] - ], + "expected": [["foo"]], "options": { "preserve_whitespaces": true }, @@ -1090,11 +882,7 @@ { "type": "HumanizeExpressionSource", "input": "{{ foo }}", - "expected": [ - [ - "foo" - ] - ], + "expected": [["foo"]], "options": { "preserve_whitespaces": true }, @@ -1113,11 +901,7 @@ { "type": "HumanizeExpressionSource", "input": "{{ foo // comment }}", - "expected": [ - [ - "foo" - ] - ], + "expected": [["foo"]], "options": { "preserve_whitespaces": true }, @@ -1136,11 +920,7 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [ - [ - "foo = true" - ] - ], + "expected": [["foo = true"]], "options": { "preserve_whitespaces": true }, @@ -1159,11 +939,7 @@ { "type": "HumanizeExpressionSource", "input": "
    \n \n{{foo}}
    ", - "expected": [ - [ - "\n \n{{ foo }}" - ] - ], + "expected": [["\n \n{{ foo }}"]], "options": { "preserve_whitespaces": true }, @@ -1182,11 +958,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{foo}}
    ", - "expected": [ - [ - "{{ foo }}" - ] - ], + "expected": [["{{ foo }}"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1203,11 +975,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "foo(); bar();" - ] - ], + "expected": [["foo(); bar();"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1218,11 +986,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "foo(); bar();" - ] - ], + "expected": [["foo(); bar();"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1239,11 +1003,7 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [ - [ - "condition ? true : false" - ] - ], + "expected": [["condition ? true : false"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1254,11 +1014,7 @@ { "type": "HumanizeExpressionSource", "input": "", - "expected": [ - [ - "condition ? true : false" - ] - ], + "expected": [["condition ? true : false"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1275,11 +1031,7 @@ { "type": "HumanizeExpressionSource", "input": "
    ", - "expected": [ - [ - "(value | async)" - ] - ], + "expected": [["(value | async)"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, @@ -1296,11 +1048,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{a.b}}
    ", - "expected": [ - [ - "" - ] - ], + "expected": [[""]], "options": null, "extract_sub_expressions": true, "find_implicit_receiver": true, @@ -1317,11 +1065,7 @@ { "type": "HumanizeExpressionSource", "input": "
    {{100}}
    ", - "expected": [ - [ - "100" - ] - ], + "expected": [["100"]], "options": null, "extract_sub_expressions": false, "find_implicit_receiver": false, diff --git a/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json b/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json index 1ca6054a72..1a84935d18 100644 --- a/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json @@ -16,12 +16,7 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [ - [ - "Text", - "a" - ] - ], + "expected": [["Text", "a"]], "ignore_error": false } ] @@ -34,18 +29,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "TextAttribute", - "a=\"b\"", - "a", - "b" - ] + ["Element", "
    ", "
    ", "
    "], + ["TextAttribute", "a=\"b\"", "a", "b"] ], "ignore_error": false } @@ -59,18 +44,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "TextAttribute", - "a", - "a", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["TextAttribute", "a", "a", ""] ], "ignore_error": false } @@ -84,18 +59,8 @@ "type": "ExpectFromHtml", "input": "\n \n", "expected": [ - [ - "Element", - "", - "", - "" - ], - [ - "Element", - "\n", - "", - "" - ] + ["Element", "", "", ""], + ["Element", "\n", "", ""] ], "ignore_error": false } @@ -114,12 +79,7 @@ { "type": "ExpectFromHtml", "input": "{{a}}", - "expected": [ - [ - "BoundText", - "{{a}}" - ] - ], + "expected": [["BoundText", "{{a}}"]], "ignore_error": false } ] @@ -138,18 +98,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "[someProp]=\"v\"", - "someProp", - "v" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "[someProp]=\"v\"", "someProp", "v"] ], "ignore_error": false } @@ -163,18 +113,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "[someProp]", - "someProp", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "[someProp]", "someProp", ""] ], "ignore_error": false } @@ -188,18 +128,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "bind-prop=\"v\"", - "prop", - "v" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "bind-prop=\"v\"", "prop", "v"] ], "ignore_error": false } @@ -213,18 +143,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "prop=\"{{v}}\"", - "prop", - "{{v}}" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "prop=\"{{v}}\"", "prop", "{{v}}"] ], "ignore_error": false } @@ -244,12 +164,7 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "data-prop=\"{{v}}\"", - "data-prop", - "{{v}}" - ] + ["BoundAttribute", "data-prop=\"{{v}}\"", "data-prop", "{{v}}"] ], "ignore_error": false } @@ -269,12 +184,7 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "bind-@animation=\"v\"", - "animation", - "v" - ] + ["BoundAttribute", "bind-@animation=\"v\"", "animation", "v"] ], "ignore_error": false } @@ -294,12 +204,7 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "bind-animate-animationName=\"v\"", - "animationName", - "v" - ] + ["BoundAttribute", "bind-animate-animationName=\"v\"", "animationName", "v"] ], "ignore_error": false } @@ -313,18 +218,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "@animation", - "animation", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "@animation", "animation", ""] ], "ignore_error": false } @@ -354,24 +249,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Template", - "
    ", - "
    ", - "
    " - ], - [ - "TextAttribute", - "ngIf", - "ngIf", - "" - ], - [ - "Element", - "
    ", - "
    ", - "
    " - ] + ["Template", "
    ", "
    ", "
    "], + ["TextAttribute", "ngIf", "ngIf", ""], + ["Element", "
    ", "
    ", "
    "] ], "ignore_error": false } @@ -385,12 +265,7 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Template", - "", - "", - "" - ] + ["Template", "", "", ""] ], "ignore_error": false } @@ -410,12 +285,7 @@ "", "" ], - [ - "Reference", - "#a", - "a", - "" - ] + ["Reference", "#a", "a", ""] ], "ignore_error": false } @@ -435,12 +305,7 @@ "", "" ], - [ - "Reference", - "#a=\"b\"", - "a", - "b" - ] + ["Reference", "#a=\"b\"", "a", "b"] ], "ignore_error": false } @@ -460,12 +325,7 @@ "", "" ], - [ - "Reference", - "ref-a", - "a", - "" - ] + ["Reference", "ref-a", "a", ""] ], "ignore_error": false } @@ -485,12 +345,7 @@ "", "" ], - [ - "TextAttribute", - "data-ref-a", - "data-ref-a", - "" - ] + ["TextAttribute", "data-ref-a", "data-ref-a", ""] ], "ignore_error": false } @@ -510,12 +365,7 @@ "", "" ], - [ - "Variable", - "let-a=\"b\"", - "a", - "b" - ] + ["Variable", "let-a=\"b\"", "a", "b"] ], "ignore_error": false } @@ -535,12 +385,7 @@ "", "" ], - [ - "TextAttribute", - "data-let-a=\"b\"", - "data-let-a", - "b" - ] + ["TextAttribute", "data-let-a=\"b\"", "data-let-a", "b"] ], "ignore_error": false } @@ -560,12 +405,7 @@ "", "" ], - [ - "TextAttribute", - "k1=\"v1\"", - "k1", - "v1" - ] + ["TextAttribute", "k1=\"v1\"", "k1", "v1"] ], "ignore_error": false } @@ -585,12 +425,7 @@ "", "" ], - [ - "BoundAttribute", - "[k1]=\"v1\"", - "k1", - "v1" - ] + ["BoundAttribute", "[k1]=\"v1\"", "k1", "v1"] ], "ignore_error": false } @@ -616,24 +451,9 @@ "
    ", "
    " ], - [ - "TextAttribute", - "ngFor", - "ngFor", - "" - ], - [ - "BoundAttribute", - "of items", - "of", - "items" - ], - [ - "Variable", - "let item ", - "item", - "" - ], + ["TextAttribute", "ngFor", "ngFor", ""], + ["BoundAttribute", "of items", "of", "items"], + ["Variable", "let item ", "item", ""], [ "Element", "
    ", @@ -653,18 +473,8 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "ngFor=\"item ", - "ngFor", - "item" - ], - [ - "BoundAttribute", - "of items", - "of", - "items" - ], + ["BoundAttribute", "ngFor=\"item ", "ngFor", "item"], + ["BoundAttribute", "of items", "of", "items"], [ "Element", "
    ", @@ -684,30 +494,10 @@ "
    ", "
    " ], - [ - "TextAttribute", - "ngFor", - "ngFor", - "" - ], - [ - "BoundAttribute", - "of items; ", - "of", - "items" - ], - [ - "BoundAttribute", - "trackBy: trackByFn", - "trackBy", - "trackByFn" - ], - [ - "Variable", - "let item ", - "item", - "" - ], + ["TextAttribute", "ngFor", "ngFor", ""], + ["BoundAttribute", "of items; ", "of", "items"], + ["BoundAttribute", "trackBy: trackByFn", "trackBy", "trackByFn"], + ["Variable", "let item ", "item", ""], [ "Element", "
    ", @@ -733,18 +523,8 @@ "
    ", "
    " ], - [ - "TextAttribute", - "ngIf", - "ngIf", - "" - ], - [ - "Variable", - "let a=b", - "a", - "b" - ], + ["TextAttribute", "ngIf", "ngIf", ""], + ["Variable", "let a=b", "a", "b"], [ "Element", "
    ", @@ -770,18 +550,8 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "ngIf=\"expr ", - "ngIf", - "expr" - ], - [ - "Variable", - "ngIf=\"expr as local", - "local", - "ngIf" - ], + ["BoundAttribute", "ngIf=\"expr ", "ngIf", "expr"], + ["Variable", "ngIf=\"expr as local", "local", "ngIf"], [ "Element", "
    ", @@ -813,12 +583,7 @@ "
    ", "
    " ], - [ - "BoundEvent", - "(someEvent)=\"v\"", - "someEvent", - "v" - ] + ["BoundEvent", "(someEvent)=\"v\"", "someEvent", "v"] ], "ignore_error": false } @@ -832,18 +597,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundEvent", - "on-event=\"v\"", - "event", - "v" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundEvent", "on-event=\"v\"", "event", "v"] ], "ignore_error": false } @@ -863,12 +618,7 @@ "
    ", "
    " ], - [ - "TextAttribute", - "data-on-event=\"v\"", - "data-on-event", - "v" - ] + ["TextAttribute", "data-on-event=\"v\"", "data-on-event", "v"] ], "ignore_error": false } @@ -882,24 +632,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "BoundAttribute", - "[(prop)]=\"v\"", - "prop", - "v" - ], - [ - "BoundEvent", - "[(prop)]=\"v\"", - "prop", - "v" - ] + ["Element", "
    ", "
    ", "
    "], + ["BoundAttribute", "[(prop)]=\"v\"", "prop", "v"], + ["BoundEvent", "[(prop)]=\"v\"", "prop", "v"] ], "ignore_error": false } @@ -919,18 +654,8 @@ "
    ", "
    " ], - [ - "BoundAttribute", - "bindon-prop=\"v\"", - "prop", - "v" - ], - [ - "BoundEvent", - "bindon-prop=\"v\"", - "prop", - "v" - ] + ["BoundAttribute", "bindon-prop=\"v\"", "prop", "v"], + ["BoundEvent", "bindon-prop=\"v\"", "prop", "v"] ], "ignore_error": false } @@ -950,12 +675,7 @@ "
    ", "
    " ], - [ - "TextAttribute", - "data-bindon-prop=\"v\"", - "data-bindon-prop", - "v" - ] + ["TextAttribute", "data-bindon-prop=\"v\"", "data-bindon-prop", "v"] ], "ignore_error": false } @@ -975,12 +695,7 @@ "
    ", "
    " ], - [ - "BoundEvent", - "(@name.done)=\"v\"", - "name.done", - "v" - ] + ["BoundEvent", "(@name.done)=\"v\"", "name.done", "v"] ], "ignore_error": false } @@ -1000,18 +715,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "Reference", - "#a", - "a", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["Reference", "#a", "a", ""] ], "ignore_error": false } @@ -1025,18 +730,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "Reference", - "#a=\"b\"", - "a", - "b" - ] + ["Element", "
    ", "
    ", "
    "], + ["Reference", "#a=\"b\"", "a", "b"] ], "ignore_error": false } @@ -1050,18 +745,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "Reference", - "ref-a", - "a", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["Reference", "ref-a", "a", ""] ], "ignore_error": false } @@ -1087,18 +772,9 @@ "", "" ], - [ - "Icu", - "{item.var, plural, other { {{item.placeholder}} items } }" - ], - [ - "Icu:Var", - "item.var" - ], - [ - "Icu:Placeholder", - "{{item.placeholder}}" - ] + ["Icu", "{item.var, plural, other { {{item.placeholder}} items } }"], + ["Icu:Var", "item.var"], + ["Icu:Placeholder", "{{item.placeholder}}"] ], "ignore_error": false } @@ -1122,22 +798,10 @@ "Icu", "{item.var, plural, other { {{item.placeholder}} {nestedVar, plural, other { {{nestedPlaceholder}} }}} }" ], - [ - "Icu:Var", - "nestedVar" - ], - [ - "Icu:Var", - "item.var" - ], - [ - "Icu:Placeholder", - "{{item.placeholder}}" - ], - [ - "Icu:Placeholder", - "{{nestedPlaceholder}}" - ] + ["Icu:Var", "nestedVar"], + ["Icu:Var", "item.var"], + ["Icu:Placeholder", "{{item.placeholder}}"], + ["Icu:Placeholder", "{{nestedPlaceholder}}"] ], "ignore_error": false } @@ -1163,96 +827,41 @@ "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate on interaction; hydrate when isVisible(); hydrate on timer(1200)) {", "}" ], - [ - "InteractionDeferredTrigger", - "hydrate on interaction" - ], - [ - "BoundDeferredTrigger", - "hydrate when isVisible()" - ], - [ - "TimerDeferredTrigger", - "hydrate on timer(1200)" - ], - [ - "BoundDeferredTrigger", - "when isVisible() && foo" - ], - [ - "HoverDeferredTrigger", - "on hover(button)" - ], - [ - "TimerDeferredTrigger", - "timer(10s)" - ], - [ - "IdleDeferredTrigger", - "idle" - ], - [ - "ImmediateDeferredTrigger", - "immediate" - ], - [ - "InteractionDeferredTrigger", - "interaction(button)" - ], - [ - "ViewportDeferredTrigger", - "viewport(container)" - ], - [ - "ImmediateDeferredTrigger", - "prefetch on immediate" - ], - [ - "BoundDeferredTrigger", - "prefetch when isDataLoaded()" - ], + ["InteractionDeferredTrigger", "hydrate on interaction"], + ["BoundDeferredTrigger", "hydrate when isVisible()"], + ["TimerDeferredTrigger", "hydrate on timer(1200)"], + ["BoundDeferredTrigger", "when isVisible() && foo"], + ["HoverDeferredTrigger", "on hover(button)"], + ["TimerDeferredTrigger", "timer(10s)"], + ["IdleDeferredTrigger", "idle"], + ["ImmediateDeferredTrigger", "immediate"], + ["InteractionDeferredTrigger", "interaction(button)"], + ["ViewportDeferredTrigger", "viewport(container)"], + ["ImmediateDeferredTrigger", "prefetch on immediate"], + ["BoundDeferredTrigger", "prefetch when isDataLoaded()"], [ "Element", "", "", "" ], - [ - "BoundAttribute", - "[date]=\"current\"", - "date", - "current" - ], + ["BoundAttribute", "[date]=\"current\"", "date", "current"], [ "DeferredBlockPlaceholder", "@placeholder (minimum 500) {Placeholder content!}", "@placeholder (minimum 500) {", "}" ], - [ - "Text", - "Placeholder content!" - ], + ["Text", "Placeholder content!"], [ "DeferredBlockLoading", "@loading (minimum 1s; after 100ms) {Loading...}", "@loading (minimum 1s; after 100ms) {", "}" ], - [ - "Text", - "Loading..." - ], - [ - "DeferredBlockError", - "@error {Loading failed :(}", - "@error {", - "}" - ], - [ - "Text", - "Loading failed :(" - ] + ["Text", "Loading..."], + ["DeferredBlockError", "@error {Loading failed :(}", "@error {", "}"], + ["Text", "Loading failed :("] ], "ignore_error": false } @@ -1278,62 +887,18 @@ "@switch (cond.kind) {", "}" ], - [ - "SwitchBlockCaseGroup", - "@case (x()) {X case}", - "@case (x()) {" - ], - [ - "SwitchBlockCase", - "@case (x()) {X case}", - "@case (x()) {" - ], - [ - "Text", - "X case" - ], - [ - "SwitchBlockCaseGroup", - "@case ('hello') {Y case}", - "@case ('hello') {" - ], - [ - "SwitchBlockCase", - "@case ('hello') {Y case}", - "@case ('hello') {" - ], - [ - "Text", - "Y case" - ], - [ - "SwitchBlockCaseGroup", - "@case (42) {Z case}", - "@case (42) {" - ], - [ - "SwitchBlockCase", - "@case (42) {Z case}", - "@case (42) {" - ], - [ - "Text", - "Z case" - ], - [ - "SwitchBlockCaseGroup", - "@default {No case matched}", - "@default {" - ], - [ - "SwitchBlockCase", - "@default {No case matched}", - "@default {" - ], - [ - "Text", - "No case matched" - ] + ["SwitchBlockCaseGroup", "@case (x()) {X case}", "@case (x()) {"], + ["SwitchBlockCase", "@case (x()) {X case}", "@case (x()) {"], + ["Text", "X case"], + ["SwitchBlockCaseGroup", "@case ('hello') {Y case}", "@case ('hello') {"], + ["SwitchBlockCase", "@case ('hello') {Y case}", "@case ('hello') {"], + ["Text", "Y case"], + ["SwitchBlockCaseGroup", "@case (42) {Z case}", "@case (42) {"], + ["SwitchBlockCase", "@case (42) {Z case}", "@case (42) {"], + ["Text", "Z case"], + ["SwitchBlockCaseGroup", "@default {No case matched}", "@default {"], + ["SwitchBlockCase", "@default {No case matched}", "@default {"], + ["Text", "No case matched"] ], "ignore_error": false } @@ -1358,34 +923,12 @@ "@case (x()) @case ('hello') {X case}", "@case (x()) @case ('hello') {" ], - [ - "SwitchBlockCase", - "@case (x()) ", - "@case (x()) " - ], - [ - "SwitchBlockCase", - "@case ('hello') {X case}", - "@case ('hello') {" - ], - [ - "Text", - "X case" - ], - [ - "SwitchBlockCaseGroup", - "@default {No case matched}", - "@default {" - ], - [ - "SwitchBlockCase", - "@default {No case matched}", - "@default {" - ], - [ - "Text", - "No case matched" - ] + ["SwitchBlockCase", "@case (x()) ", "@case (x()) "], + ["SwitchBlockCase", "@case ('hello') {X case}", "@case ('hello') {"], + ["Text", "X case"], + ["SwitchBlockCaseGroup", "@default {No case matched}", "@default {"], + ["SwitchBlockCase", "@default {No case matched}", "@default {"], + ["Text", "No case matched"] ], "ignore_error": false } @@ -1405,25 +948,10 @@ "@switch (cond.kind) {", "}" ], - [ - "SwitchBlockCaseGroup", - "@case (x()) {X case}", - "@case (x()) {" - ], - [ - "SwitchBlockCase", - "@case (x()) {X case}", - "@case (x()) {" - ], - [ - "Text", - "X case" - ], - [ - "SwitchExhaustiveCheck", - "@default never;", - "@default never;" - ] + ["SwitchBlockCaseGroup", "@case (x()) {X case}", "@case (x()) {"], + ["SwitchBlockCase", "@case (x()) {X case}", "@case (x()) {"], + ["Text", "X case"], + ["SwitchExhaustiveCheck", "@default never;", "@default never;"] ], "ignore_error": false } @@ -1449,79 +977,19 @@ "@for (item of items.foo.bar; track item.id; let i = $index, _o_d_d_ = $odd) {", "}" ], - [ - "Variable", - "item", - "item", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "", - "", - "" - ], - [ - "Variable", - "i = $index", - "i", - "$index" - ], - [ - "Variable", - "_o_d_d_ = $odd", - "_o_d_d_", - "$odd" - ], - [ - "Element", - "

    {{ item }}

    ", - "

    ", - "

    " - ], - [ - "BoundText", - "{{ item }}" - ], - [ - "ForLoopBlockEmpty", - "@empty {There were no items in the list.}", - "@empty {" - ], - [ - "Text", - "There were no items in the list." - ] + ["Variable", "item", "item", ""], + ["Variable", "", "", ""], + ["Variable", "", "", ""], + ["Variable", "", "", ""], + ["Variable", "", "", ""], + ["Variable", "", "", ""], + ["Variable", "", "", ""], + ["Variable", "i = $index", "i", "$index"], + ["Variable", "_o_d_d_ = $odd", "_o_d_d_", "$odd"], + ["Element", "

    {{ item }}

    ", "

    ", "

    "], + ["BoundText", "{{ item }}"], + ["ForLoopBlockEmpty", "@empty {There were no items in the list.}", "@empty {"], + ["Text", "There were no items in the list."] ], "ignore_error": false } @@ -1552,34 +1020,16 @@ "@if (cond.expr; as foo) {Main case was true!}", "@if (cond.expr; as foo) {" ], - [ - "Variable", - "foo", - "foo", - "" - ], - [ - "Text", - "Main case was true!" - ], + ["Variable", "foo", "foo", ""], + ["Text", "Main case was true!"], [ "IfBlockBranch", "@else if (other.expr) {Extra case was true!}", "@else if (other.expr) {" ], - [ - "Text", - "Extra case was true!" - ], - [ - "IfBlockBranch", - "@else {False case!}", - "@else {" - ], - [ - "Text", - "False case!" - ] + ["Text", "Extra case was true!"], + ["IfBlockBranch", "@else {False case!}", "@else {"], + ["Text", "False case!"] ], "ignore_error": false } @@ -1598,14 +1048,7 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123;", - "expected": [ - [ - "LetDeclaration", - "@let foo = 123;", - "foo", - "123" - ] - ], + "expected": [["LetDeclaration", "@let foo = 123;", "foo", "123"]], "ignore_error": false } ] @@ -1623,14 +1066,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Component", - "", - "", - "" - ] - ], + "expected": [["Component", "", "", ""]], "ignore_error": true } ] @@ -1642,14 +1078,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Component", - "", - "", - "" - ] - ], + "expected": [["Component", "", "", ""]], "ignore_error": true } ] @@ -1687,52 +1116,14 @@ "", "" ], - [ - "TextAttribute", - "before=\"foo\"", - "before", - "foo" - ], - [ - "TextAttribute", - "middle", - "middle", - "" - ], - [ - "TextAttribute", - "after=\"123\"", - "after", - "123" - ], - [ - "Directive", - "@Dir", - "@Dir", - "" - ], - [ - "Directive", - "@OtherDir([a]=\"a\" (b)=\"b()\")", - "@OtherDir(", - ")" - ], - [ - "BoundAttribute", - "[a]=\"a\"", - "a", - "a" - ], - [ - "BoundEvent", - "(b)=\"b()\"", - "b", - "b()" - ], - [ - "Text", - "Hello" - ] + ["TextAttribute", "before=\"foo\"", "before", "foo"], + ["TextAttribute", "middle", "middle", ""], + ["TextAttribute", "after=\"123\"", "after", "123"], + ["Directive", "@Dir", "@Dir", ""], + ["Directive", "@OtherDir([a]=\"a\" (b)=\"b()\")", "@OtherDir(", ")"], + ["BoundAttribute", "[a]=\"a\"", "a", "a"], + ["BoundEvent", "(b)=\"b()\"", "b", "b()"], + ["Text", "Hello"] ], "ignore_error": true } @@ -1763,28 +1154,15 @@ "
    ", "
    " ], - [ - "Text", - "Hello: " - ], + ["Text", "Hello: "], [ "Component", "", "", "" ], - [ - "Element", - "", - "", - "" - ], - [ - "Component", - "", - "", - "" - ] + ["Element", "", "", ""], + ["Component", "", "", ""] ], "ignore_error": true } @@ -1804,18 +1182,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "
    ", - "
    ", - "
    " - ], - [ - "Directive", - "@Dir", - "@Dir", - "" - ] + ["Element", "
    ", "
    ", "
    "], + ["Directive", "@Dir", "@Dir", ""] ], "ignore_error": true } @@ -1835,30 +1203,10 @@ "
    ", "
    " ], - [ - "Directive", - "@Dir(a=\"1\" [b]=\"two\" (c)=\"c()\")", - "@Dir(", - ")" - ], - [ - "TextAttribute", - "a=\"1\"", - "a", - "1" - ], - [ - "BoundAttribute", - "[b]=\"two\"", - "b", - "two" - ], - [ - "BoundEvent", - "(c)=\"c()\"", - "c", - "c()" - ] + ["Directive", "@Dir(a=\"1\" [b]=\"two\" (c)=\"c()\")", "@Dir(", ")"], + ["TextAttribute", "a=\"1\"", "a", "1"], + ["BoundAttribute", "[b]=\"two\"", "b", "two"], + ["BoundEvent", "(c)=\"c()\"", "c", "c()"] ], "ignore_error": true } @@ -1878,48 +1226,13 @@ "
    ", "
    " ], - [ - "TextAttribute", - "before=\"foo\"", - "before", - "foo" - ], - [ - "TextAttribute", - "middle", - "middle", - "" - ], - [ - "TextAttribute", - "after=\"123\"", - "after", - "123" - ], - [ - "Directive", - "@Dir", - "@Dir", - "" - ], - [ - "Directive", - "@OtherDir([a]=\"a\" (b)=\"b()\")", - "@OtherDir(", - ")" - ], - [ - "BoundAttribute", - "[a]=\"a\"", - "a", - "a" - ], - [ - "BoundEvent", - "(b)=\"b()\"", - "b", - "b()" - ] + ["TextAttribute", "before=\"foo\"", "before", "foo"], + ["TextAttribute", "middle", "middle", ""], + ["TextAttribute", "after=\"123\"", "after", "123"], + ["Directive", "@Dir", "@Dir", ""], + ["Directive", "@OtherDir([a]=\"a\" (b)=\"b()\")", "@OtherDir(", ")"], + ["BoundAttribute", "[a]=\"a\"", "a", "a"], + ["BoundEvent", "(b)=\"b()\"", "b", "b()"] ], "ignore_error": true } diff --git a/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json b/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json index 4c39898728..361e6de008 100644 --- a/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json @@ -28,66 +28,20 @@ "type": "ExpectFromHtml", "input": "\n @boundary {\n
    Content
    \n } @error (when err instanceof SpecificError) {\n
    Specific Error
    \n } @error (let err) {\n
    General Error {{ err }}
    \n }\n ", "expected": [ - [ - "BoundaryBlock" - ], - [ - "Element", - "div" - ], - [ - "Text", - "Content" - ], - [ - "BoundaryErrorBlock", - "err instanceof SpecificError" - ], - [ - "Variable", - "$error", - "$error" - ], - [ - "Variable", - "$reset", - "$reset" - ], - [ - "Element", - "div" - ], - [ - "Text", - "Specific Error" - ], - [ - "BoundaryErrorBlock", - null - ], - [ - "Variable", - "$error", - "$error" - ], - [ - "Variable", - "$reset", - "$reset" - ], - [ - "Variable", - "err", - "$error" - ], - [ - "Element", - "div" - ], - [ - "BoundText", - "General Error {{ err }}" - ] + ["BoundaryBlock"], + ["Element", "div"], + ["Text", "Content"], + ["BoundaryErrorBlock", "err instanceof SpecificError"], + ["Variable", "$error", "$error"], + ["Variable", "$reset", "$reset"], + ["Element", "div"], + ["Text", "Specific Error"], + ["BoundaryErrorBlock", null], + ["Variable", "$error", "$error"], + ["Variable", "$reset", "$reset"], + ["Variable", "err", "$error"], + ["Element", "div"], + ["BoundText", "General Error {{ err }}"] ], "ignore_error": false } @@ -106,12 +60,7 @@ { "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "a" - ], - [ - "Element", - "span" - ] + ["Element", "a"], + ["Element", "span"] ], "ignore_error": true } @@ -144,12 +87,7 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [ - [ - "Text", - "a" - ] - ], + "expected": [["Text", "a"]], "ignore_error": false } ] @@ -162,15 +100,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "a", - "b" - ] + ["Element", "div"], + ["TextAttribute", "a", "b"] ], "ignore_error": false } @@ -189,15 +120,8 @@ "type": "ExpectFromHtml", "input": " \n ", "expected": [ - [ - "Content", - "a" - ], - [ - "TextAttribute", - "select", - "a" - ] + ["Content", "a"], + ["TextAttribute", "select", "a"] ], "ignore_error": false } @@ -211,19 +135,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - ":svg:svg" - ], - [ - "Content", - "a" - ], - [ - "TextAttribute", - "select", - "a" - ] + ["Element", ":svg:svg"], + ["Content", "a"], + ["TextAttribute", "select", "a"] ], "ignore_error": false } @@ -247,12 +161,7 @@ { "type": "ExpectFromHtml", "input": "{{a}}", - "expected": [ - [ - "BoundText", - "{{ a }}" - ] - ], + "expected": [["BoundText", "{{ a }}"]], "ignore_error": false } ] @@ -271,16 +180,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "someProp", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 0, "someProp", "v"] ], "ignore_error": false } @@ -294,16 +195,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "prop", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 0, "prop", "v"] ], "ignore_error": false } @@ -322,16 +215,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "prop", - "{{ v }}" - ] + ["Element", "div"], + ["BoundAttribute", 0, "prop", "{{ v }}"] ], "ignore_error": false } @@ -345,16 +230,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "some-prop", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 0, "some-prop", "v"] ], "ignore_error": false } @@ -368,16 +245,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "d.ot", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 0, "d.ot", "v"] ], "ignore_error": false } @@ -391,16 +260,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 0, - "mappedAttr", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 0, "mappedAttr", "v"] ], "ignore_error": false } @@ -414,16 +275,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 1, - "someAttr", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 1, "someAttr", "v"] ], "ignore_error": false } @@ -437,16 +290,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 2, - "some-class", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 2, "some-class", "v"] ], "ignore_error": false } @@ -460,16 +305,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 2, - "someClass", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 2, "someClass", "v"] ], "ignore_error": false } @@ -483,22 +320,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 2, - "px-3.5", - "v" - ], - [ - "BoundAttribute", - 2, - "a.b.c", - "w" - ] + ["Element", "div"], + ["BoundAttribute", 2, "px-3.5", "v"], + ["BoundAttribute", 2, "a.b.c", "w"] ], "ignore_error": false } @@ -512,16 +336,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 3, - "someStyle", - "v" - ] + ["Element", "div"], + ["BoundAttribute", 3, "someStyle", "v"] ], "ignore_error": false } @@ -535,34 +351,11 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "foo", - "#selfClosing" - ], - [ - "TextAttribute", - "some-attr", - "" - ], - [ - "BoundAttribute", - 2, - "text-primary/80", - "expr" - ], - [ - "BoundAttribute", - 2, - "data-active:text-green-300/80", - "expr2" - ], - [ - "BoundAttribute", - 2, - "data-[size='large']:p-8", - "expr3" - ] + ["Element", "foo", "#selfClosing"], + ["TextAttribute", "some-attr", ""], + ["BoundAttribute", 2, "text-primary/80", "expr"], + ["BoundAttribute", 2, "data-active:text-green-300/80", "expr2"], + ["BoundAttribute", 2, "data-[size='large']:p-8", "expr3"] ], "ignore_error": false } @@ -587,15 +380,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "animate.enter", - "foo" - ] + ["Element", "div"], + ["TextAttribute", "animate.enter", "foo"] ], "ignore_error": false }, @@ -603,16 +389,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 6.0, - "animate.enter", - "[\"foo\", \"bar\"]" - ] + ["Element", "div"], + ["BoundAttribute", 6.0, "animate.enter", "[\"foo\", \"bar\"]"] ], "ignore_error": false }, @@ -620,17 +398,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 3.0, - "animate.enter", - null, - "animateFn($event)" - ] + ["Element", "div"], + ["BoundEvent", 3.0, "animate.enter", null, "animateFn($event)"] ], "ignore_error": false } @@ -644,15 +413,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "animate.leave", - "foo" - ] + ["Element", "div"], + ["TextAttribute", "animate.leave", "foo"] ], "ignore_error": false }, @@ -660,16 +422,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 6.0, - "animate.leave", - "[\"foo\", \"bar\"]" - ] + ["Element", "div"], + ["BoundAttribute", 6.0, "animate.leave", "[\"foo\", \"bar\"]"] ], "ignore_error": false }, @@ -677,17 +431,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 3.0, - "animate.leave", - null, - "animateFn($event)" - ] + ["Element", "div"], + ["BoundEvent", 3.0, "animate.leave", null, "animateFn($event)"] ], "ignore_error": false }, @@ -695,17 +440,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 0.0, - "animateXYZ", - null, - "animateFn()" - ] + ["Element", "div"], + ["BoundEvent", 0.0, "animateXYZ", null, "animateFn()"] ], "ignore_error": false } @@ -724,20 +460,7 @@ { "type": "ExpectFromHtml", "input": "
    ", - "expected": [ - [ - "Template" - ], - [ - "TextAttribute", - "ngIf", - "" - ], - [ - "Element", - "div" - ] - ], + "expected": [["Template"], ["TextAttribute", "ngIf", ""], ["Element", "div"]], "ignore_error": false } ] @@ -749,11 +472,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Template" - ] - ], + "expected": [["Template"]], "ignore_error": false } ] @@ -765,15 +484,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Element", - ":svg:svg" - ], - [ - "Template" - ] - ], + "expected": [["Element", ":svg:svg"], ["Template"]], "ignore_error": false } ] @@ -785,20 +496,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Template" - ], - [ - "BoundAttribute", - 0.0, - "ngIf", - "true" - ], - [ - "Template" - ] - ], + "expected": [["Template"], ["BoundAttribute", 0.0, "ngIf", "true"], ["Template"]], "ignore_error": false } ] @@ -810,16 +508,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Template" - ], - [ - "Reference", - "a", - "" - ] - ], + "expected": [["Template"], ["Reference", "a", ""]], "ignore_error": false } ] @@ -831,16 +520,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Template" - ], - [ - "Reference", - "a", - "" - ] - ], + "expected": [["Template"], ["Reference", "a", ""]], "ignore_error": false } ] @@ -857,16 +537,7 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [ - [ - "Template" - ], - [ - "Variable", - "a", - "b" - ] - ], + "expected": [["Template"], ["Variable", "a", "b"]], "ignore_error": false } ] @@ -879,19 +550,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Template" - ], - [ - "TextAttribute", - "k1", - "v1" - ], - [ - "TextAttribute", - "k2", - "v2" - ] + ["Template"], + ["TextAttribute", "k1", "v1"], + ["TextAttribute", "k2", "v2"] ], "ignore_error": false } @@ -905,21 +566,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Template" - ], - [ - "BoundAttribute", - 0, - "k1", - "v1" - ], - [ - "BoundAttribute", - 0, - "k2", - "v2" - ] + ["Template"], + ["BoundAttribute", 0, "k1", "v1"], + ["BoundAttribute", 0, "k2", "v2"] ], "ignore_error": false } @@ -939,29 +588,11 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Template" - ], - [ - "TextAttribute", - "ngFor", - "" - ], - [ - "BoundAttribute", - 0, - "ngForOf", - "items" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Element", - "div" - ] + ["Template"], + ["TextAttribute", "ngFor", ""], + ["BoundAttribute", 0, "ngForOf", "items"], + ["Variable", "item", "$implicit"], + ["Element", "div"] ], "ignore_error": false }, @@ -969,25 +600,10 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Template" - ], - [ - "BoundAttribute", - 0, - "ngFor", - "item" - ], - [ - "BoundAttribute", - 0, - "ngForOf", - "items" - ], - [ - "Element", - "div" - ] + ["Template"], + ["BoundAttribute", 0, "ngFor", "item"], + ["BoundAttribute", 0, "ngForOf", "items"], + ["Element", "div"] ], "ignore_error": false } @@ -1001,23 +617,10 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Template" - ], - [ - "TextAttribute", - "ngIf", - "" - ], - [ - "Variable", - "a", - "b" - ], - [ - "Element", - "div" - ] + ["Template"], + ["TextAttribute", "ngIf", ""], + ["Variable", "a", "b"], + ["Element", "div"] ], "ignore_error": false } @@ -1031,24 +634,10 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Template" - ], - [ - "BoundAttribute", - 0, - "ngIf", - "expr" - ], - [ - "Variable", - "local", - "ngIf" - ], - [ - "Element", - "div" - ] + ["Template"], + ["BoundAttribute", 0, "ngIf", "expr"], + ["Variable", "local", "ngIf"], + ["Element", "div"] ], "ignore_error": false } @@ -1068,17 +657,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 0, - "event", - "window", - "v" - ] + ["Element", "div"], + ["BoundEvent", 0, "event", "window", "v"] ], "ignore_error": false } @@ -1092,17 +672,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 0, - "some-event", - null, - "v" - ] + ["Element", "div"], + ["BoundEvent", 0, "some-event", null, "v"] ], "ignore_error": false }, @@ -1110,17 +681,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 0, - "someEvent", - null, - "v" - ] + ["Element", "div"], + ["BoundEvent", 0, "someEvent", null, "v"] ], "ignore_error": false } @@ -1134,17 +696,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 0, - "event", - null, - "v" - ] + ["Element", "div"], + ["BoundEvent", 0, "event", null, "v"] ], "ignore_error": false } @@ -1163,23 +716,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "v" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "v" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "v"], + ["BoundEvent", 2, "propChange", null, "v"] ], "ignore_error": false } @@ -1193,23 +732,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "$any(v)" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "$any(v)" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "$any(v)"], + ["BoundEvent", 2, "propChange", null, "$any(v)"] ], "ignore_error": false } @@ -1223,23 +748,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "v" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "v" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "v"], + ["BoundEvent", 2, "propChange", null, "v"] ], "ignore_error": false } @@ -1253,23 +764,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "v!" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "v!" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "v!"], + ["BoundEvent", 2, "propChange", null, "v!"] ], "ignore_error": false } @@ -1283,23 +780,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "a.b.c" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "a.b.c" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "a.b.c"], + ["BoundEvent", 2, "propChange", null, "a.b.c"] ], "ignore_error": false } @@ -1313,23 +796,9 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundAttribute", - 5, - "prop", - "a[\"b\"][\"c\"]" - ], - [ - "BoundEvent", - 2, - "propChange", - null, - "a[\"b\"][\"c\"]" - ] + ["Element", "div"], + ["BoundAttribute", 5, "prop", "a[\"b\"][\"c\"]"], + ["BoundEvent", 2, "propChange", null, "a[\"b\"][\"c\"]"] ], "ignore_error": false } @@ -1373,17 +842,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "BoundEvent", - 1, - "", - null, - "onAnimationEvent($event)" - ] + ["Element", "div"], + ["BoundEvent", 1, "", null, "onAnimationEvent($event)"] ], "ignore_error": true } @@ -1424,15 +884,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "Reference", - "a", - "" - ] + ["Element", "div"], + ["Reference", "a", ""] ], "ignore_error": false } @@ -1446,15 +899,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "Reference", - "a", - "" - ] + ["Element", "div"], + ["Reference", "a", ""] ], "ignore_error": false } @@ -1468,15 +914,8 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "Reference", - "someA", - "" - ] + ["Element", "div"], + ["Reference", "someA", ""] ], "ignore_error": false } @@ -1568,12 +1007,7 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [ - [ - "Text", - "a" - ] - ], + "expected": [["Text", "a"]], "ignore_error": false } ] @@ -1586,23 +1020,10 @@ "type": "ExpectFromHtml", "input": "safe", "expected": [ - [ - "Element", - ":xhtml:div" - ], - [ - "TextAttribute", - ":xmlns:xhtml", - "http://www.w3.org/1999/xhtml" - ], - [ - "Element", - ":xhtml:span" - ], - [ - "Text", - "safe" - ] + ["Element", ":xhtml:div"], + ["TextAttribute", ":xmlns:xhtml", "http://www.w3.org/1999/xhtml"], + ["Element", ":xhtml:span"], + ["Text", "safe"] ], "ignore_error": false } @@ -1615,12 +1036,7 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [ - [ - "Text", - "a" - ] - ], + "expected": [["Text", "a"]], "ignore_error": false } ] @@ -1633,18 +1049,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - ":svg:svg" - ], - [ - "Element", - ":svg:style" - ], - [ - "Text", - ".a { fill: none; }" - ] + ["Element", ":svg:svg"], + ["Element", ":svg:style"], + ["Text", ".a { fill: none; }"] ], "ignore_error": false } @@ -1664,20 +1071,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "link" - ], - [ - "TextAttribute", - "rel", - "stylesheet" - ], - [ - "TextAttribute", - "href", - "http://someurl" - ] + ["Element", "link"], + ["TextAttribute", "rel", "stylesheet"], + ["TextAttribute", "href", "http://someurl"] ], "ignore_error": false }, @@ -1685,20 +1081,9 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "link" - ], - [ - "TextAttribute", - "REL", - "stylesheet" - ], - [ - "TextAttribute", - "href", - "http://someurl" - ] + ["Element", "link"], + ["TextAttribute", "REL", "stylesheet"], + ["TextAttribute", "href", "http://someurl"] ], "ignore_error": false } @@ -1712,15 +1097,8 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "link" - ], - [ - "TextAttribute", - "rel", - "stylesheet" - ] + ["Element", "link"], + ["TextAttribute", "rel", "stylesheet"] ], "ignore_error": false }, @@ -1728,15 +1106,8 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - [ - "Element", - "link" - ], - [ - "TextAttribute", - "REL", - "stylesheet" - ] + ["Element", "link"], + ["TextAttribute", "REL", "stylesheet"] ], "ignore_error": false } @@ -1774,19 +1145,9 @@ "type": "ExpectFromHtml", "input": "
    {{b}}
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Text", - "{{b}}" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Text", "{{b}}"] ], "ignore_error": false } @@ -1800,23 +1161,10 @@ "type": "ExpectFromHtml", "input": "
    {{b}}
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Element", - "span" - ], - [ - "Text", - "{{b}}" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Element", "span"], + ["Text", "{{b}}"] ], "ignore_error": false } @@ -1830,19 +1178,9 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Text", - "a" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Text", "a"] ], "ignore_error": false } @@ -1856,23 +1194,10 @@ "type": "ExpectFromHtml", "input": "safe", "expected": [ - [ - "Element", - ":foo:div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Element", - ":foo:span" - ], - [ - "Text", - "safe" - ] + ["Element", ":foo:div"], + ["TextAttribute", "ngNonBindable", ""], + ["Element", ":foo:span"], + ["Text", "safe"] ], "ignore_error": false } @@ -1886,19 +1211,9 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Text", - "a" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Text", "a"] ], "ignore_error": false } @@ -1912,19 +1227,9 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Text", - "a" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Text", "a"] ], "ignore_error": false } @@ -2057,17 +1362,9 @@ "type": "ExpectFromHtml", "input": "@defer (on idle(1)) {hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger", - 1.0 - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger", 1.0], + ["Text", "hello"] ], "ignore_error": false } @@ -2214,15 +1511,7 @@ { "type": "ExpectFromHtml", "input": "@defer{hello}", - "expected": [ - [ - "DeferredBlock" - ], - [ - "Text", - "hello" - ] - ], + "expected": [["DeferredBlock"], ["Text", "hello"]], "ignore_error": false } ] @@ -2235,17 +1524,9 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible() && loaded){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "BoundDeferredTrigger", - "isVisible() && loaded" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["BoundDeferredTrigger", "isVisible() && loaded"], + ["Text", "hello"] ], "ignore_error": false } @@ -2258,18 +1539,7 @@ { "type": "ExpectFromHtml", "input": "@defer (on idle){hello}", - "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "Text", - "hello" - ] - ], + "expected": [["DeferredBlock"], ["IdleDeferredTrigger"], ["Text", "hello"]], "ignore_error": false } ] @@ -2282,20 +1552,10 @@ "type": "ExpectFromHtml", "input": "@defer (on idle, viewport(button)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["Text", "hello"] ], "ignore_error": false } @@ -2309,23 +1569,11 @@ "type": "ExpectFromHtml", "input": "@defer (on idle, viewport(button), immediate){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "ImmediateDeferredTrigger" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["ImmediateDeferredTrigger"], + ["Text", "hello"] ], "ignore_error": false } @@ -2339,28 +1587,12 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible(); on timer(100ms), idle, viewport(button)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "BoundDeferredTrigger", - "isVisible()" - ], - [ - "TimerDeferredTrigger", - 100.0 - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["BoundDeferredTrigger", "isVisible()"], + ["TimerDeferredTrigger", 100.0], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["Text", "hello"] ], "ignore_error": false } @@ -2374,28 +1606,12 @@ "type": "ExpectFromHtml", "input": "@defer(\nwhen\nisVisible(); on\ntimer(100ms),\nidle, viewport(button)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "BoundDeferredTrigger", - "isVisible()" - ], - [ - "TimerDeferredTrigger", - 100.0 - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["BoundDeferredTrigger", "isVisible()"], + ["TimerDeferredTrigger", 100.0], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["Text", "hello"] ], "ignore_error": false } @@ -2409,17 +1625,9 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(10s)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "TimerDeferredTrigger", - 10000.0 - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["TimerDeferredTrigger", 10000.0], + ["Text", "hello"] ], "ignore_error": false } @@ -2433,17 +1641,9 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(1.5s)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "TimerDeferredTrigger", - 1500.0 - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["TimerDeferredTrigger", 1500.0], + ["Text", "hello"] ], "ignore_error": false } @@ -2457,17 +1657,9 @@ "type": "ExpectFromHtml", "input": "@defer (on timer(100)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "TimerDeferredTrigger", - 100.0 - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["TimerDeferredTrigger", 100.0], + ["Text", "hello"] ], "ignore_error": false } @@ -2481,17 +1673,9 @@ "type": "ExpectFromHtml", "input": "@defer (on hover(button)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "HoverDeferredTrigger", - "button" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["HoverDeferredTrigger", "button"], + ["Text", "hello"] ], "ignore_error": false } @@ -2505,17 +1689,9 @@ "type": "ExpectFromHtml", "input": "@defer (on interaction(button)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "InteractionDeferredTrigger", - "button" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["InteractionDeferredTrigger", "button"], + ["Text", "hello"] ], "ignore_error": false } @@ -2529,41 +1705,15 @@ "type": "ExpectFromHtml", "input": "@defer {}@loading {Loading...}@placeholder {Placeholder content!}@error {Loading failed :(}", "expected": [ - [ - "DeferredBlock" - ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "BoundAttribute", - 0.0, - "date", - "current" - ], - [ - "DeferredBlockPlaceholder" - ], - [ - "Text", - "Placeholder content!" - ], - [ - "DeferredBlockLoading" - ], - [ - "Text", - "Loading..." - ], - [ - "DeferredBlockError" - ], - [ - "Text", - "Loading failed :(" - ] + ["DeferredBlock"], + ["Element", "calendar-cmp", "#selfClosing"], + ["BoundAttribute", 0.0, "date", "current"], + ["DeferredBlockPlaceholder"], + ["Text", "Placeholder content!"], + ["DeferredBlockLoading"], + ["Text", "Loading..."], + ["DeferredBlockError"], + ["Text", "Loading failed :("] ], "ignore_error": false } @@ -2577,41 +1727,15 @@ "type": "ExpectFromHtml", "input": "@defer {} @loading {Loading...} @placeholder {Placeholder content!} @error {Loading failed :(}", "expected": [ - [ - "DeferredBlock" - ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "BoundAttribute", - 0.0, - "date", - "current" - ], - [ - "DeferredBlockPlaceholder" - ], - [ - "Text", - "Placeholder content!" - ], - [ - "DeferredBlockLoading" - ], - [ - "Text", - "Loading..." - ], - [ - "DeferredBlockError" - ], - [ - "Text", - "Loading failed :(" - ] + ["DeferredBlock"], + ["Element", "calendar-cmp", "#selfClosing"], + ["BoundAttribute", 0.0, "date", "current"], + ["DeferredBlockPlaceholder"], + ["Text", "Placeholder content!"], + ["DeferredBlockLoading"], + ["Text", "Loading..."], + ["DeferredBlockError"], + ["Text", "Loading failed :("] ], "ignore_error": false } @@ -2630,29 +1754,11 @@ "type": "ExpectFromHtml", "input": "@defer{}@loading (after 100ms; minimum 1.5s){Loading...}", "expected": [ - [ - "DeferredBlock" - ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "BoundAttribute", - 0.0, - "date", - "current" - ], - [ - "DeferredBlockLoading", - "after 100ms", - "minimum 1500ms" - ], - [ - "Text", - "Loading..." - ] + ["DeferredBlock"], + ["Element", "calendar-cmp", "#selfClosing"], + ["BoundAttribute", 0.0, "date", "current"], + ["DeferredBlockLoading", "after 100ms", "minimum 1500ms"], + ["Text", "Loading..."] ], "ignore_error": false } @@ -2666,28 +1772,11 @@ "type": "ExpectFromHtml", "input": "@defer {}@placeholder (minimum 1.5s){Placeholder...}", "expected": [ - [ - "DeferredBlock" - ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "BoundAttribute", - 0.0, - "date", - "current" - ], - [ - "DeferredBlockPlaceholder", - "minimum 1500ms" - ], - [ - "Text", - "Placeholder..." - ] + ["DeferredBlock"], + ["Element", "calendar-cmp", "#selfClosing"], + ["BoundAttribute", 0.0, "date", "current"], + ["DeferredBlockPlaceholder", "minimum 1500ms"], + ["Text", "Placeholder..."] ], "ignore_error": false } @@ -2701,28 +1790,12 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on viewport(button), hover(button); prefetch when shouldPrefetch()){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "HoverDeferredTrigger", - "button" - ], - [ - "BoundDeferredTrigger", - "shouldPrefetch()" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["HoverDeferredTrigger", "button"], + ["BoundDeferredTrigger", "shouldPrefetch()"], + ["Text", "hello"] ], "ignore_error": false } @@ -2736,20 +1809,10 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on idle(100)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "IdleDeferredTrigger", - 100.0 - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger"], + ["IdleDeferredTrigger", 100.0], + ["Text", "hello"] ], "ignore_error": false } @@ -2763,20 +1826,10 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on idle(100)){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger", - 100.0 - ], - [ - "IdleDeferredTrigger" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger", 100.0], + ["IdleDeferredTrigger"], + ["Text", "hello"] ], "ignore_error": false } @@ -2790,28 +1843,12 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; prefetch on viewport(button), hover(button); prefetch when shouldPrefetch()){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "IdleDeferredTrigger" - ], - [ - "ViewportDeferredTrigger", - "button" - ], - [ - "HoverDeferredTrigger", - "button" - ], - [ - "BoundDeferredTrigger", - "shouldPrefetch()" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["IdleDeferredTrigger"], + ["ViewportDeferredTrigger", "button"], + ["HoverDeferredTrigger", "button"], + ["BoundDeferredTrigger", "shouldPrefetch()"], + ["Text", "hello"] ], "ignore_error": false } @@ -2825,19 +1862,10 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate never){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "NeverDeferredTrigger" - ], - [ - "IdleDeferredTrigger" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["NeverDeferredTrigger"], + ["IdleDeferredTrigger"], + ["Text", "hello"] ], "ignore_error": false } @@ -2851,32 +1879,13 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on viewport, hover, timer(500); hydrate when shouldHydrate()){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "ViewportDeferredTrigger", - null - ], - [ - "HoverDeferredTrigger", - null - ], - [ - "TimerDeferredTrigger", - 500.0 - ], - [ - "BoundDeferredTrigger", - "shouldHydrate()" - ], - [ - "IdleDeferredTrigger" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["ViewportDeferredTrigger", null], + ["HoverDeferredTrigger", null], + ["TimerDeferredTrigger", 500.0], + ["BoundDeferredTrigger", "shouldHydrate()"], + ["IdleDeferredTrigger"], + ["Text", "hello"] ], "ignore_error": false } @@ -2890,28 +1899,12 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate on viewport, hover; hydrate when shouldHydrate()){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "ViewportDeferredTrigger", - null - ], - [ - "HoverDeferredTrigger", - null - ], - [ - "BoundDeferredTrigger", - "shouldHydrate()" - ], - [ - "IdleDeferredTrigger" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["ViewportDeferredTrigger", null], + ["HoverDeferredTrigger", null], + ["BoundDeferredTrigger", "shouldHydrate()"], + ["IdleDeferredTrigger"], + ["Text", "hello"] ], "ignore_error": false } @@ -2925,85 +1918,26 @@ "type": "ExpectFromHtml", "input": "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){}@loading (minimum 1s; after 100ms){Loading...}@placeholder (minimum 500){Placeholder content!}@error {Loading failed :(}", "expected": [ - [ - "DeferredBlock" - ], - [ - "BoundDeferredTrigger", - "shouldHydrate()" - ], - [ - "ViewportDeferredTrigger", - null - ], - [ - "BoundDeferredTrigger", - "isVisible() && foo" - ], - [ - "HoverDeferredTrigger", - "button" - ], - [ - "TimerDeferredTrigger", - 10000.0 - ], - [ - "IdleDeferredTrigger" - ], - [ - "ImmediateDeferredTrigger" - ], - [ - "InteractionDeferredTrigger", - "button" - ], - [ - "ViewportDeferredTrigger", - "container" - ], - [ - "ImmediateDeferredTrigger" - ], - [ - "BoundDeferredTrigger", - "isDataLoaded()" - ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "BoundAttribute", - 0.0, - "date", - "current" - ], - [ - "DeferredBlockPlaceholder", - "minimum 500ms" - ], - [ - "Text", - "Placeholder content!" - ], - [ - "DeferredBlockLoading", - "after 100ms", - "minimum 1000ms" - ], - [ - "Text", - "Loading..." - ], - [ - "DeferredBlockError" - ], - [ - "Text", - "Loading failed :(" - ] + ["DeferredBlock"], + ["BoundDeferredTrigger", "shouldHydrate()"], + ["ViewportDeferredTrigger", null], + ["BoundDeferredTrigger", "isVisible() && foo"], + ["HoverDeferredTrigger", "button"], + ["TimerDeferredTrigger", 10000.0], + ["IdleDeferredTrigger"], + ["ImmediateDeferredTrigger"], + ["InteractionDeferredTrigger", "button"], + ["ViewportDeferredTrigger", "container"], + ["ImmediateDeferredTrigger"], + ["BoundDeferredTrigger", "isDataLoaded()"], + ["Element", "calendar-cmp", "#selfClosing"], + ["BoundAttribute", 0.0, "date", "current"], + ["DeferredBlockPlaceholder", "minimum 500ms"], + ["Text", "Placeholder content!"], + ["DeferredBlockLoading", "after 100ms", "minimum 1000ms"], + ["Text", "Loading..."], + ["DeferredBlockError"], + ["Text", "Loading failed :("] ], "ignore_error": false } @@ -3017,69 +1951,24 @@ "type": "ExpectFromHtml", "input": "
    @defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){}@loading (minimum 1s; after 100ms){Loading...}@placeholder (minimum 500){Placeholder content!}@error {Loading failed :(}
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], [ "Text", "@defer (when isVisible() && foo; on hover(button), timer(10s), idle, immediate, interaction(button), viewport(container); prefetch on immediate; prefetch when isDataLoaded(); hydrate when shouldHydrate(); hydrate on viewport){" ], - [ - "Element", - "calendar-cmp", - "#selfClosing" - ], - [ - "TextAttribute", - "[date]", - "current" - ], - [ - "Text", - "}" - ], - [ - "Text", - "@loading (minimum 1s; after 100ms){" - ], - [ - "Text", - "Loading..." - ], - [ - "Text", - "}" - ], - [ - "Text", - "@placeholder (minimum 500){" - ], - [ - "Text", - "Placeholder content!" - ], - [ - "Text", - "}" - ], - [ - "Text", - "@error {" - ], - [ - "Text", - "Loading failed :(" - ], - [ - "Text", - "}" - ] + ["Element", "calendar-cmp", "#selfClosing"], + ["TextAttribute", "[date]", "current"], + ["Text", "}"], + ["Text", "@loading (minimum 1s; after 100ms){"], + ["Text", "Loading..."], + ["Text", "}"], + ["Text", "@placeholder (minimum 500){"], + ["Text", "Placeholder content!"], + ["Text", "}"], + ["Text", "@error {"], + ["Text", "Loading failed :("], + ["Text", "}"] ], "ignore_error": false } @@ -3093,45 +1982,16 @@ "type": "ExpectFromHtml", "input": "@defer (on hover, interaction, viewport; prefetch on hover, interaction, viewport) {hello}@placeholder {}", "expected": [ - [ - "DeferredBlock" - ], - [ - "HoverDeferredTrigger", - null - ], - [ - "InteractionDeferredTrigger", - null - ], - [ - "ViewportDeferredTrigger", - null - ], - [ - "HoverDeferredTrigger", - null - ], - [ - "InteractionDeferredTrigger", - null - ], - [ - "ViewportDeferredTrigger", - null - ], - [ - "Text", - "hello" - ], - [ - "DeferredBlockPlaceholder" - ], - [ - "Element", - "implied-trigger", - "#selfClosing" - ] + ["DeferredBlock"], + ["HoverDeferredTrigger", null], + ["InteractionDeferredTrigger", null], + ["ViewportDeferredTrigger", null], + ["HoverDeferredTrigger", null], + ["InteractionDeferredTrigger", null], + ["ViewportDeferredTrigger", null], + ["Text", "hello"], + ["DeferredBlockPlaceholder"], + ["Element", "implied-trigger", "#selfClosing"] ], "ignore_error": false } @@ -3145,18 +2005,13 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({trigger: foo, rootMargin: \"123px\", scrollMargin: \"456px\", threshold: [1, 2, 3]})){hello}", "expected": [ - [ - "DeferredBlock" - ], + ["DeferredBlock"], [ "ViewportDeferredTrigger", "foo", "{rootMargin: \"123px\", scrollMargin: \"456px\", threshold: [1, 2, 3]}" ], - [ - "Text", - "hello" - ] + ["Text", "hello"] ], "ignore_error": false } @@ -3170,18 +2025,9 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({rootMargin: \"123px\"})){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "ViewportDeferredTrigger", - null, - "{rootMargin: \"123px\"}" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["ViewportDeferredTrigger", null, "{rootMargin: \"123px\"}"], + ["Text", "hello"] ], "ignore_error": false }, @@ -3189,18 +2035,9 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({rootMargin: \"123px\"})){hello}", "expected": [ - [ - "DeferredBlock" - ], - [ - "ViewportDeferredTrigger", - null, - "{rootMargin: \"123px\"}" - ], - [ - "Text", - "hello" - ] + ["DeferredBlock"], + ["ViewportDeferredTrigger", null, "{rootMargin: \"123px\"}"], + ["Text", "hello"] ], "ignore_error": false } @@ -3297,58 +2134,20 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n @case (x()) { X case }\n @case ('hello') {}\n @case (42) { Z case }\n @default { No case matched }\n }\n ", "expected": [ - [ - "SwitchBlock", - "cond.kind" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "x()" - ], - [ - "Text", - " X case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"hello\"" - ], - [ - "Element", - "button" - ], - [ - "Text", - "Y case" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "42" - ], - [ - "Text", - " Z case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "Text", - " No case matched " - ] + ["SwitchBlock", "cond.kind"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "x()"], + ["Text", " X case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"hello\""], + ["Element", "button"], + ["Text", "Y case"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "42"], + ["Text", " Z case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["Text", " No case matched "] ], "ignore_error": false } @@ -3361,29 +2160,13 @@ { "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", - "expected": [ - [ - "SwitchBlock", - "cond.kind" - ], - [ - "SwitchExhaustiveCheck" - ] - ], + "expected": [["SwitchBlock", "cond.kind"], ["SwitchExhaustiveCheck"]], "ignore_error": false }, { "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", - "expected": [ - [ - "SwitchBlock", - "cond.kind" - ], - [ - "SwitchExhaustiveCheck" - ] - ], + "expected": [["SwitchBlock", "cond.kind"], ["SwitchExhaustiveCheck"]], "ignore_error": false } ] @@ -3401,58 +2184,20 @@ "type": "ExpectFromHtml", "input": "\n @switch ((cond.kind)) {\n @case ((x())) { X case }\n @case (('hello')) {}\n @case ((42)) { Z case }\n @default { No case matched }\n }\n ", "expected": [ - [ - "SwitchBlock", - "(cond.kind)" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "(x())" - ], - [ - "Text", - " X case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "(\"hello\")" - ], - [ - "Element", - "button" - ], - [ - "Text", - "Y case" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "(42)" - ], - [ - "Text", - " Z case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "Text", - " No case matched " - ] + ["SwitchBlock", "(cond.kind)"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "(x())"], + ["Text", " X case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "(\"hello\")"], + ["Element", "button"], + ["Text", "Y case"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "(42)"], + ["Text", " Z case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["Text", " No case matched "] ], "ignore_error": false } @@ -3466,135 +2211,41 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond) {\n @case ('a') {\n @switch (innerCond) {\n @case ('innerA') { Inner A }\n @case ('innerB') { Inner B }\n }\n }\n @case ('b') {}\n @case ('c') { Z case }\n @default {\n @switch (innerCond) {\n @case ('innerC') { Inner C }\n @case ('innerD') { Inner D }\n @default {\n @switch (innerInnerCond) {\n @case ('innerInnerA') { Inner inner A }\n @case ('innerInnerA') { Inner inner B }\n }\n }\n }\n }\n }\n ", "expected": [ - [ - "SwitchBlock", - "cond" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"a\"" - ], - [ - "SwitchBlock", - "innerCond" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerA\"" - ], - [ - "Text", - " Inner A " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerB\"" - ], - [ - "Text", - " Inner B " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"b\"" - ], - [ - "Element", - "button" - ], - [ - "Text", - "Y case" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"c\"" - ], - [ - "Text", - " Z case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "SwitchBlock", - "innerCond" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerC\"" - ], - [ - "Text", - " Inner C " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerD\"" - ], - [ - "Text", - " Inner D " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "SwitchBlock", - "innerInnerCond" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerInnerA\"" - ], - [ - "Text", - " Inner inner A " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"innerInnerA\"" - ], - [ - "Text", - " Inner inner B " - ] + ["SwitchBlock", "cond"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"a\""], + ["SwitchBlock", "innerCond"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerA\""], + ["Text", " Inner A "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerB\""], + ["Text", " Inner B "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"b\""], + ["Element", "button"], + ["Text", "Y case"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"c\""], + ["Text", " Z case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["SwitchBlock", "innerCond"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerC\""], + ["Text", " Inner C "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerD\""], + ["Text", " Inner D "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["SwitchBlock", "innerInnerCond"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerInnerA\""], + ["Text", " Inner inner A "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"innerInnerA\""], + ["Text", " Inner inner B "] ], "ignore_error": false } @@ -3608,32 +2259,13 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond.kind) {\n \n @case (x) { X case }\n\n \n @default { No case matched }\n }\n ", "expected": [ - [ - "SwitchBlock", - "cond.kind" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "x" - ], - [ - "Text", - " X case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "Text", - " No case matched " - ] + ["SwitchBlock", "cond.kind"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "x"], + ["Text", " X case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["Text", " No case matched "] ], "ignore_error": false } @@ -3647,55 +2279,19 @@ "type": "ExpectFromHtml", "input": "\n @switch (cond) {\n @case ('a') @case('b') @case('c') @case('d') { ABCD case }\n @case ('z') { Z case }\n @default { No case matched }\n }\n ", "expected": [ - [ - "SwitchBlock", - "cond" - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"a\"" - ], - [ - "SwitchBlockCase", - "\"b\"" - ], - [ - "SwitchBlockCase", - "\"c\"" - ], - [ - "SwitchBlockCase", - "\"d\"" - ], - [ - "Text", - " ABCD case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - "\"z\"" - ], - [ - "Text", - " Z case " - ], - [ - "SwitchBlockCaseGroup" - ], - [ - "SwitchBlockCase", - null - ], - [ - "Text", - " No case matched " - ] + ["SwitchBlock", "cond"], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"a\""], + ["SwitchBlockCase", "\"b\""], + ["SwitchBlockCase", "\"c\""], + ["SwitchBlockCase", "\"d\""], + ["Text", " ABCD case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", "\"z\""], + ["Text", " Z case "], + ["SwitchBlockCaseGroup"], + ["SwitchBlockCase", null], + ["Text", " No case matched "] ], "ignore_error": false } @@ -3812,57 +2408,17 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id) {\n {{ item }}\n } @empty {\n There were no items in the list.\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ], - [ - "ForLoopBlockEmpty" - ], - [ - "Text", - " There were no items in the list. " - ] + ["ForLoopBlock", "items.foo.bar", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "], + ["ForLoopBlockEmpty"], + ["Text", " There were no items in the list. "] ], "ignore_error": false } @@ -3876,50 +2432,15 @@ "type": "ExpectFromHtml", "input": "\n @for ((item of items.foo.bar); track item.id){\n {{ item }}\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ] + ["ForLoopBlock", "items.foo.bar", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "] ], "ignore_error": false }, @@ -3927,50 +2448,15 @@ "type": "ExpectFromHtml", "input": "\n @for ((item of items.foo.bar()); track item.id) {\n {{ item }}\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar()", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ] + ["ForLoopBlock", "items.foo.bar()", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "] ], "ignore_error": false }, @@ -3978,50 +2464,15 @@ "type": "ExpectFromHtml", "input": "\n @for (( ( (item of items.foo.bar()) ) ); track item.id) {\n {{ item }}\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar()", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ] + ["ForLoopBlock", "items.foo.bar()", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "] ], "ignore_error": false } @@ -4033,169 +2484,51 @@ "assertions": [ { "type": "ExpectFromHtml", - "input": "\n @for (item of items.foo.bar; track item.id; let idx = $index, f = $first, c = $count; let l = $last, ev = $even, od = $odd) {\n {{ item }}\n }\n ", - "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "Variable", - "idx", - "$index" - ], - [ - "Variable", - "f", - "$first" - ], - [ - "Variable", - "c", - "$count" - ], - [ - "Variable", - "l", - "$last" - ], - [ - "Variable", - "ev", - "$even" - ], - [ - "Variable", - "od", - "$odd" - ], - [ - "BoundText", - " {{ item }} " - ] - ], - "ignore_error": false - } - ] - }, - { - "name": "should parse a for loop block with newlines in its let parameters", - "path": "R3 template transform/for loop blocks/should parse a for loop block with newlines in its let parameters", - "assertions": [ - { - "type": "ExpectFromHtml", - "input": "\n @for (item of items.foo.bar; track item.id; let\nidx = $index,\nf = $first,\nc = $count,\nl = $last,\nev = $even,\nod = $odd) {\n {{ item }}\n }\n ", - "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "Variable", - "idx", - "$index" - ], - [ - "Variable", - "f", - "$first" - ], - [ - "Variable", - "c", - "$count" - ], - [ - "Variable", - "l", - "$last" - ], - [ - "Variable", - "ev", - "$even" - ], - [ - "Variable", - "od", - "$odd" - ], - [ - "BoundText", - " {{ item }} " - ] + "input": "\n @for (item of items.foo.bar; track item.id; let idx = $index, f = $first, c = $count; let l = $last, ev = $even, od = $odd) {\n {{ item }}\n }\n ", + "expected": [ + ["ForLoopBlock", "items.foo.bar", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["Variable", "idx", "$index"], + ["Variable", "f", "$first"], + ["Variable", "c", "$count"], + ["Variable", "l", "$last"], + ["Variable", "ev", "$even"], + ["Variable", "od", "$odd"], + ["BoundText", " {{ item }} "] + ], + "ignore_error": false + } + ] + }, + { + "name": "should parse a for loop block with newlines in its let parameters", + "path": "R3 template transform/for loop blocks/should parse a for loop block with newlines in its let parameters", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "\n @for (item of items.foo.bar; track item.id; let\nidx = $index,\nf = $first,\nc = $count,\nl = $last,\nev = $even,\nod = $odd) {\n {{ item }}\n }\n ", + "expected": [ + ["ForLoopBlock", "items.foo.bar", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["Variable", "idx", "$index"], + ["Variable", "f", "$first"], + ["Variable", "c", "$count"], + ["Variable", "l", "$last"], + ["Variable", "ev", "$even"], + ["Variable", "od", "$odd"], + ["BoundText", " {{ item }} "] ], "ignore_error": false } @@ -4209,109 +2542,28 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track item.id) {\n {{ item }}\n\n
    \n @for (subitem of item.items; track subitem.id) {

    {{subitem}}

    }\n
    \n } @empty {\n There were no items in the list.\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ], - [ - "Element", - "div" - ], - [ - "ForLoopBlock", - "item.items", - "subitem.id" - ], - [ - "Variable", - "subitem", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "Element", - "h1" - ], - [ - "BoundText", - "{{ subitem }}" - ], - [ - "ForLoopBlockEmpty" - ], - [ - "Text", - " There were no items in the list. " - ] + ["ForLoopBlock", "items.foo.bar", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "], + ["Element", "div"], + ["ForLoopBlock", "item.items", "subitem.id"], + ["Variable", "subitem", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["Element", "h1"], + ["BoundText", "{{ subitem }}"], + ["ForLoopBlockEmpty"], + ["Text", " There were no items in the list. "] ], "ignore_error": false } @@ -4325,50 +2577,15 @@ "type": "ExpectFromHtml", "input": "\n @for (item of items.foo.bar; track trackBy(item.id, 123)) {\n {{ item }}\n }\n ", "expected": [ - [ - "ForLoopBlock", - "items.foo.bar", - "trackBy(item.id, 123)" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ] + ["ForLoopBlock", "items.foo.bar", "trackBy(item.id, 123)"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "] ], "ignore_error": false } @@ -4400,50 +2617,15 @@ "type": "ExpectFromHtml", "input": "\n @for (item of [\n { id: 1 },\n { id: 2 }\n ]; track item.id) {\n {{ item }}\n }\n ", "expected": [ - [ - "ForLoopBlock", - "[{id: 1}, {id: 2}]", - "item.id" - ], - [ - "Variable", - "item", - "$implicit" - ], - [ - "Variable", - "$index", - "$index" - ], - [ - "Variable", - "$first", - "$first" - ], - [ - "Variable", - "$last", - "$last" - ], - [ - "Variable", - "$even", - "$even" - ], - [ - "Variable", - "$odd", - "$odd" - ], - [ - "Variable", - "$count", - "$count" - ], - [ - "BoundText", - " {{ item }} " - ] + ["ForLoopBlock", "[{id: 1}, {id: 2}]", "item.id"], + ["Variable", "item", "$implicit"], + ["Variable", "$index", "$index"], + ["Variable", "$first", "$first"], + ["Variable", "$last", "$last"], + ["Variable", "$even", "$even"], + ["Variable", "$odd", "$odd"], + ["Variable", "$count", "$count"], + ["BoundText", " {{ item }} "] ], "ignore_error": false } @@ -4540,38 +2722,14 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr) {\n Extra case was true!\n } @else {\n False case!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "cond.expr" - ], - [ - "Variable", - "foo", - "foo" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "other.expr" - ], - [ - "Text", - " Extra case was true! " - ], - [ - "IfBlockBranch", - null - ], - [ - "Text", - " False case! " - ] + ["IfBlock"], + ["IfBlockBranch", "cond.expr"], + ["Variable", "foo", "foo"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "other.expr"], + ["Text", " Extra case was true! "], + ["IfBlockBranch", null], + ["Text", " False case! "] ], "ignore_error": false } @@ -4585,33 +2743,13 @@ "type": "ExpectFromHtml", "input": "\n @if ((cond.expr)) {\n Main case was true!\n } @else if ((other.expr)) {\n Extra case was true!\n } @else {\n False case!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "(cond.expr)" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "(other.expr)" - ], - [ - "Text", - " Extra case was true! " - ], - [ - "IfBlockBranch", - null - ], - [ - "Text", - " False case! " - ] + ["IfBlock"], + ["IfBlockBranch", "(cond.expr)"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "(other.expr)"], + ["Text", " Extra case was true! "], + ["IfBlockBranch", null], + ["Text", " False case! "] ], "ignore_error": false } @@ -4625,71 +2763,23 @@ "type": "ExpectFromHtml", "input": "\n @if (a) {\n @if (a1) {\n a1\n } @else {\n b1\n }\n }\n @else if (b) {\n b\n } @else {\n @if (c1) {\n c1\n } @else if (c2) {\n c2\n } @else {\n c3\n }\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "a" - ], - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "a1" - ], - [ - "Text", - " a1 " - ], - [ - "IfBlockBranch", - null - ], - [ - "Text", - " b1 " - ], - [ - "IfBlockBranch", - "b" - ], - [ - "Text", - " b " - ], - [ - "IfBlockBranch", - null - ], - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "c1" - ], - [ - "Text", - " c1 " - ], - [ - "IfBlockBranch", - "c2" - ], - [ - "Text", - " c2 " - ], - [ - "IfBlockBranch", - null - ], - [ - "Text", - " c3 " - ] + ["IfBlock"], + ["IfBlockBranch", "a"], + ["IfBlock"], + ["IfBlockBranch", "a1"], + ["Text", " a1 "], + ["IfBlockBranch", null], + ["Text", " b1 "], + ["IfBlockBranch", "b"], + ["Text", " b "], + ["IfBlockBranch", null], + ["IfBlock"], + ["IfBlockBranch", "c1"], + ["Text", " c1 "], + ["IfBlockBranch", "c2"], + ["Text", " c2 "], + ["IfBlockBranch", null], + ["Text", " c3 "] ], "ignore_error": false } @@ -4703,30 +2793,12 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr) {\n Other case was true!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "cond.expr" - ], - [ - "Variable", - "foo", - "foo" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "other.expr" - ], - [ - "Text", - " Other case was true! " - ] + ["IfBlock"], + ["IfBlockBranch", "cond.expr"], + ["Variable", "foo", "foo"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "other.expr"], + ["Text", " Other case was true! "] ], "ignore_error": false } @@ -4740,30 +2812,12 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else\tif (other.expr) {\n Other case was true!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "cond.expr" - ], - [ - "Variable", - "foo", - "foo" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "other.expr" - ], - [ - "Text", - " Other case was true! " - ] + ["IfBlock"], + ["IfBlockBranch", "cond.expr"], + ["Variable", "foo", "foo"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "other.expr"], + ["Text", " Other case was true! "] ], "ignore_error": false } @@ -4777,38 +2831,14 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n }\n \n @else if (other.expr) {\n Extra case was true!\n }\n \n @else {\n False case!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "cond.expr" - ], - [ - "Variable", - "foo", - "foo" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "other.expr" - ], - [ - "Text", - " Extra case was true! " - ], - [ - "IfBlockBranch", - null - ], - [ - "Text", - " False case! " - ] + ["IfBlock"], + ["IfBlockBranch", "cond.expr"], + ["Variable", "foo", "foo"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "other.expr"], + ["Text", " Extra case was true! "], + ["IfBlockBranch", null], + ["Text", " False case! "] ], "ignore_error": false } @@ -4822,35 +2852,13 @@ "type": "ExpectFromHtml", "input": "\n @if (cond.expr; as foo) {\n Main case was true!\n } @else if (other.expr; as bar) {\n Other case was true!\n }\n ", "expected": [ - [ - "IfBlock" - ], - [ - "IfBlockBranch", - "cond.expr" - ], - [ - "Variable", - "foo", - "foo" - ], - [ - "Text", - " Main case was true! " - ], - [ - "IfBlockBranch", - "other.expr" - ], - [ - "Variable", - "bar", - "bar" - ], - [ - "Text", - " Other case was true! " - ] + ["IfBlock"], + ["IfBlockBranch", "cond.expr"], + ["Variable", "foo", "foo"], + ["Text", " Main case was true! "], + ["IfBlockBranch", "other.expr"], + ["Variable", "bar", "bar"], + ["Text", " Other case was true! "] ], "ignore_error": false } @@ -4869,13 +2877,7 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123 + 456;", - "expected": [ - [ - "LetDeclaration", - "foo", - "123 + 456" - ] - ], + "expected": [["LetDeclaration", "foo", "123 + 456"]], "ignore_error": false } ] @@ -4898,19 +2900,9 @@ "type": "ExpectFromHtml", "input": "
    @let foo = 123;
    ", "expected": [ - [ - "Element", - "div" - ], - [ - "TextAttribute", - "ngNonBindable", - "" - ], - [ - "Text", - "@let foo = 123;" - ] + ["Element", "div"], + ["TextAttribute", "ngNonBindable", ""], + ["Text", "@let foo = 123;"] ], "ignore_error": false } @@ -5064,18 +3056,9 @@ "type": "ExpectFromHtml", "input": "\n @content(icon) {\n Icon content\n }\n ", "expected": [ - [ - "ContentBlock", - "icon" - ], - [ - "Element", - "span" - ], - [ - "Text", - "Icon content" - ] + ["ContentBlock", "icon"], + ["Element", "span"], + ["Text", "Icon content"] ], "ignore_error": false } @@ -5104,28 +3087,11 @@ "type": "ExpectFromHtml", "input": "\n @content(icon; let a, b) {\n Icon content\n }\n ", "expected": [ - [ - "ContentBlock", - "icon" - ], - [ - "Variable", - "a", - "" - ], - [ - "Variable", - "b", - "" - ], - [ - "Element", - "span" - ], - [ - "Text", - "Icon content" - ] + ["ContentBlock", "icon"], + ["Variable", "a", ""], + ["Variable", "b", ""], + ["Element", "span"], + ["Text", "Icon content"] ], "ignore_error": false } diff --git a/crates/angular_conformance/fixtures/render3_style_parser_spec.json b/crates/angular_conformance/fixtures/render3_style_parser_spec.json index b82513b09f..2eb3b8bc02 100644 --- a/crates/angular_conformance/fixtures/render3_style_parser_spec.json +++ b/crates/angular_conformance/fixtures/render3_style_parser_spec.json @@ -16,10 +16,7 @@ { "type": "ParseStyle", "input": "content: \"foo\"", - "expected": [ - "content", - "\"foo\"" - ] + "expected": ["content", "\"foo\""] } ] }, @@ -30,10 +27,7 @@ { "type": "ParseStyle", "input": "width: \"1px\"", - "expected": [ - "width", - "\"1px\"" - ] + "expected": ["width", "\"1px\""] } ] } @@ -102,14 +96,7 @@ { "type": "ParseStyle", "input": "width:100px;height:200px;opacity:0", - "expected": [ - "width", - "100px", - "height", - "200px", - "opacity", - "0" - ] + "expected": ["width", "100px", "height", "200px", "opacity", "0"] } ] }, @@ -120,12 +107,7 @@ { "type": "ParseStyle", "input": "width:;height: ;", - "expected": [ - "width", - "", - "height", - "" - ] + "expected": ["width", "", "height", ""] } ] }, @@ -136,14 +118,7 @@ { "type": "ParseStyle", "input": "width :333px ; height:666px ; opacity: 0.5;", - "expected": [ - "width", - "333px", - "height", - "666px", - "opacity", - "0.5" - ] + "expected": ["width", "333px", "height", "666px", "opacity", "0.5"] } ] }, @@ -154,12 +129,7 @@ { "type": "ParseStyle", "input": "content: \"foo; man: guy\"; width: 100px", - "expected": [ - "content", - "\"foo; man: guy\"", - "width", - "100px" - ] + "expected": ["content", "\"foo; man: guy\"", "width", "100px"] } ] }, @@ -175,10 +145,7 @@ { "type": "ParseStyle", "input": "background-image: url(\"foo.jpg\")", - "expected": [ - "background-image", - "url(\"foo.jpg\")" - ] + "expected": ["background-image", "url(\"foo.jpg\")"] } ] }, @@ -189,12 +156,7 @@ { "type": "ParseStyle", "input": "color: rgba(calc(50 * 4), var(--cool), :5;); height: 100px;", - "expected": [ - "color", - "rgba(calc(50 * 4), var(--cool), :5;)", - "height", - "100px" - ] + "expected": ["color", "rgba(calc(50 * 4), var(--cool), :5;)", "height", "100px"] } ] }, @@ -205,10 +167,7 @@ { "type": "ParseStyle", "input": "borderWidth: 200px", - "expected": [ - "border-width", - "200px" - ] + "expected": ["border-width", "200px"] } ] }