diff --git a/crates/angular_conformance/fixtures/compiler_facade_interface_spec.json b/crates/angular_conformance/fixtures/compiler_facade_interface_spec.json index 581ec8324..e1be5035d 100644 --- a/crates/angular_conformance/fixtures/compiler_facade_interface_spec.json +++ b/crates/angular_conformance/fixtures/compiler_facade_interface_spec.json @@ -1,5 +1,5 @@ { "name": "compiler_facade_interface_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/compiler_facade_interface_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/compiler_facade_interface_spec.ts", "test_groups": [] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/expression_parser_ast_spec.json b/crates/angular_conformance/fixtures/expression_parser_ast_spec.json index 4af87fa72..62f572878 100644 --- a/crates/angular_conformance/fixtures/expression_parser_ast_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_ast_spec.json @@ -1,6 +1,6 @@ { "name": "ast_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/ast_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/ast_spec.ts", "test_groups": [ { "name": "RecursiveAstVisitor", @@ -14,4 +14,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json b/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json index 9dbe2a637..58c61753b 100644 --- a/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_lexer_spec.json @@ -1,6 +1,6 @@ { "name": "lexer_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/lexer_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/lexer_spec.ts", "test_groups": [ { "name": "lexer", @@ -4211,4 +4211,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/expression_parser_parser_spec.json b/crates/angular_conformance/fixtures/expression_parser_parser_spec.json index 29d3ea7a3..90908eaa1 100644 --- a/crates/angular_conformance/fixtures/expression_parser_parser_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_parser_spec.json @@ -1,6 +1,6 @@ { "name": "parser_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/parser_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/parser_spec.ts", "test_groups": [ { "name": "parser", @@ -2074,17 +2074,6 @@ } ] }, - { - "name": "should report missing comma between arrow function parameters", - "path": "parser/parseBinding/arrow functions/arrow function validations/should report missing comma between arrow function parameters", - "assertions": [ - { - "type": "ExpectBindingError", - "input": "(a b) => a + b", - "error_contains": "Missing expected ," - } - ] - }, { "name": "should report an error inside the arrow function expression", "path": "parser/parseBinding/arrow functions/arrow function validations/should report an error inside the arrow function expression", @@ -2756,4 +2745,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json b/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json index ac501d75e..f997dfe85 100644 --- a/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json +++ b/crates/angular_conformance/fixtures/expression_parser_serializer_spec.json @@ -1,6 +1,6 @@ { "name": "serializer_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/serializer_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/expression_parser/serializer_spec.ts", "test_groups": [ { "name": "serializer", @@ -355,4 +355,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_digest_spec.json b/crates/angular_conformance/fixtures/i18n_digest_spec.json index 05d859c67..5e388c576 100644 --- a/crates/angular_conformance/fixtures/i18n_digest_spec.json +++ b/crates/angular_conformance/fixtures/i18n_digest_spec.json @@ -1,6 +1,6 @@ { "name": "digest_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/digest_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/digest_spec.ts", "test_groups": [ { "name": "digest", @@ -67,4 +67,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_extractor_merger_spec.json b/crates/angular_conformance/fixtures/i18n_extractor_merger_spec.json index a44b45078..ec07696e7 100644 --- a/crates/angular_conformance/fixtures/i18n_extractor_merger_spec.json +++ b/crates/angular_conformance/fixtures/i18n_extractor_merger_spec.json @@ -1,6 +1,6 @@ { "name": "extractor_merger_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/extractor_merger_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/extractor_merger_spec.ts", "test_groups": [ { "name": "Extractor", @@ -153,8 +153,8 @@ "assertions": [] }, { - "name": "should ignore implicit elements in non translatable ICU messages", - "path": "Extractor/ICU messages/should ignore implicit elements in non translatable ICU messages", + "name": "should ignore implicit elements in non translatable ICU messages 2", + "path": "Extractor/ICU messages/should ignore implicit elements in non translatable ICU messages 2", "assertions": [] } ] @@ -394,4 +394,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_i18n_ast_spec.json b/crates/angular_conformance/fixtures/i18n_i18n_ast_spec.json index 818089368..946c6581a 100644 --- a/crates/angular_conformance/fixtures/i18n_i18n_ast_spec.json +++ b/crates/angular_conformance/fixtures/i18n_i18n_ast_spec.json @@ -1,6 +1,6 @@ { "name": "i18n_ast_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_ast_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_ast_spec.ts", "test_groups": [ { "name": "Message", @@ -50,4 +50,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_i18n_html_parser_spec.json b/crates/angular_conformance/fixtures/i18n_i18n_html_parser_spec.json index c2d406a0f..add99bca4 100644 --- a/crates/angular_conformance/fixtures/i18n_i18n_html_parser_spec.json +++ b/crates/angular_conformance/fixtures/i18n_i18n_html_parser_spec.json @@ -1,6 +1,6 @@ { "name": "i18n_html_parser_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_html_parser_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_html_parser_spec.ts", "test_groups": [ { "name": "I18N html parser", @@ -14,4 +14,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_i18n_parser_spec.json b/crates/angular_conformance/fixtures/i18n_i18n_parser_spec.json index eb1a7575f..2d3edfdf3 100644 --- a/crates/angular_conformance/fixtures/i18n_i18n_parser_spec.json +++ b/crates/angular_conformance/fixtures/i18n_i18n_parser_spec.json @@ -1,6 +1,6 @@ { "name": "i18n_parser_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_parser_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/i18n_parser_spec.ts", "test_groups": [ { "name": "I18nParser", @@ -212,4 +212,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_integration_xliff2_spec.json b/crates/angular_conformance/fixtures/i18n_integration_xliff2_spec.json index 0355e11dc..2a2ba0bb1 100644 --- a/crates/angular_conformance/fixtures/i18n_integration_xliff2_spec.json +++ b/crates/angular_conformance/fixtures/i18n_integration_xliff2_spec.json @@ -1,5 +1,5 @@ { "name": "integration_xliff2_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xliff2_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xliff2_spec.ts", "test_groups": [] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_integration_xliff_spec.json b/crates/angular_conformance/fixtures/i18n_integration_xliff_spec.json index 08aa18a4c..ff3233492 100644 --- a/crates/angular_conformance/fixtures/i18n_integration_xliff_spec.json +++ b/crates/angular_conformance/fixtures/i18n_integration_xliff_spec.json @@ -1,5 +1,5 @@ { "name": "integration_xliff_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xliff_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xliff_spec.ts", "test_groups": [] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_integration_xmb_xtb_spec.json b/crates/angular_conformance/fixtures/i18n_integration_xmb_xtb_spec.json index c666a5ebe..fb33bca66 100644 --- a/crates/angular_conformance/fixtures/i18n_integration_xmb_xtb_spec.json +++ b/crates/angular_conformance/fixtures/i18n_integration_xmb_xtb_spec.json @@ -1,5 +1,5 @@ { "name": "integration_xmb_xtb_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts", "test_groups": [] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_message_bundle_spec.json b/crates/angular_conformance/fixtures/i18n_message_bundle_spec.json index f71ab7303..72fc048e9 100644 --- a/crates/angular_conformance/fixtures/i18n_message_bundle_spec.json +++ b/crates/angular_conformance/fixtures/i18n_message_bundle_spec.json @@ -1,6 +1,6 @@ { "name": "message_bundle_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/message_bundle_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/message_bundle_spec.ts", "test_groups": [ { "name": "MessageBundle", @@ -25,4 +25,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_i18n_ast_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_i18n_ast_spec.json index 086c1dd80..a04662aaf 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_i18n_ast_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_i18n_ast_spec.json @@ -1,6 +1,6 @@ { "name": "i18n_ast_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/i18n_ast_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/i18n_ast_spec.ts", "test_groups": [ { "name": "i18n AST", @@ -31,4 +31,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_placeholder_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_placeholder_spec.json index f09cdf163..6c57afd76 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_placeholder_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_placeholder_spec.json @@ -1,6 +1,6 @@ { "name": "placeholder_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/placeholder_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/placeholder_spec.ts", "test_groups": [ { "name": "PlaceholderRegistry", @@ -92,4 +92,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_xliff2_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_xliff2_spec.json index b284b7571..2e12bb012 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_xliff2_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_xliff2_spec.json @@ -1,6 +1,6 @@ { "name": "xliff2_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xliff2_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xliff2_spec.ts", "test_groups": [ { "name": "XLIFF 2.0 serializer", @@ -83,4 +83,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_xliff_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_xliff_spec.json index 07e541405..bce4cf208 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_xliff_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_xliff_spec.json @@ -1,6 +1,6 @@ { "name": "xliff_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xliff_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xliff_spec.ts", "test_groups": [ { "name": "XLIFF serializer", @@ -84,4 +84,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_xmb_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_xmb_spec.json index 4b8dfa494..d59f5bf3b 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_xmb_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_xmb_spec.json @@ -1,6 +1,6 @@ { "name": "xmb_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xmb_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xmb_spec.ts", "test_groups": [ { "name": "XMB serializer", @@ -19,4 +19,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_xml_helper_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_xml_helper_spec.json index 2e502b051..a9db59022 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_xml_helper_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_xml_helper_spec.json @@ -1,6 +1,6 @@ { "name": "xml_helper_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xml_helper_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xml_helper_spec.ts", "test_groups": [ { "name": "XML helper", @@ -44,4 +44,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_serializers_xtb_spec.json b/crates/angular_conformance/fixtures/i18n_serializers_xtb_spec.json index 91aed981f..97dca28ef 100644 --- a/crates/angular_conformance/fixtures/i18n_serializers_xtb_spec.json +++ b/crates/angular_conformance/fixtures/i18n_serializers_xtb_spec.json @@ -1,6 +1,6 @@ { "name": "xtb_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xtb_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/serializers/xtb_spec.ts", "test_groups": [ { "name": "XTB serializer", @@ -91,4 +91,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_translation_bundle_spec.json b/crates/angular_conformance/fixtures/i18n_translation_bundle_spec.json index 0e9fbace6..79b7117dd 100644 --- a/crates/angular_conformance/fixtures/i18n_translation_bundle_spec.json +++ b/crates/angular_conformance/fixtures/i18n_translation_bundle_spec.json @@ -1,6 +1,6 @@ { "name": "translation_bundle_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/translation_bundle_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/translation_bundle_spec.ts", "test_groups": [ { "name": "TranslationBundle", @@ -71,4 +71,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/i18n_whitespace_sensitivity_spec.json b/crates/angular_conformance/fixtures/i18n_whitespace_sensitivity_spec.json index cdb8b6ef3..90477b2a7 100644 --- a/crates/angular_conformance/fixtures/i18n_whitespace_sensitivity_spec.json +++ b/crates/angular_conformance/fixtures/i18n_whitespace_sensitivity_spec.json @@ -1,6 +1,6 @@ { "name": "whitespace_sensitivity_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/whitespace_sensitivity_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/i18n/whitespace_sensitivity_spec.ts", "test_groups": [ { "name": "i18nPreserveWhitespaceForLegacyExtraction", @@ -35,4 +35,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/integration_spec.json b/crates/angular_conformance/fixtures/integration_spec.json index d23da8112..2327a7b0d 100644 --- a/crates/angular_conformance/fixtures/integration_spec.json +++ b/crates/angular_conformance/fixtures/integration_spec.json @@ -1,6 +1,6 @@ { "name": "integration_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/integration_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/integration_spec.ts", "test_groups": [ { "name": "integration tests", @@ -31,4 +31,4 @@ "tests": [] } ] -} +} \ No newline at end of file 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 8cf0a1423..be7a98812 100644 --- a/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_ast_serializer_spec.json @@ -1,6 +1,6 @@ { "name": "ast_serializer_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/ast_serializer_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/ast_serializer_spec.ts", "test_groups": [ { "name": "Node serializer", @@ -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": [ + "" + ] } ] }, @@ -77,4 +87,4 @@ ] } ] -} +} \ No newline at end of file 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 3a8800645..c69b06789 100644 --- a/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_html_parser_spec.json @@ -1,6 +1,6 @@ { "name": "html_parser_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/html_parser_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/html_parser_spec.ts", "test_groups": [ { "name": "HtmlParser", @@ -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,84 @@ "type": "HumanizeDom", "input": "
🛈
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Text", "🛈", 1.0, [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "🛈", + 1.0, + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] + ] + } + ] + }, + { + "name": "should parse named HTML entities containing digits", + "path": "HtmlParser/parse/text nodes/should parse named HTML entities containing digits", + "assertions": [ + { + "type": "HumanizeDom", + "input": "
¹
", + "expected": [ + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "¹", + 1.0, + [ + "" + ], + [ + "¹", + "¹" + ], + [ + "" + ] + ] + ] + }, + { + "type": "HumanizeDom", + "input": "
½
", + "expected": [ + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Text", + "½", + 1.0, + [ + "" + ], + [ + "½", + "½" + ], + [ + "" + ] + ] ] } ] @@ -108,7 +242,13 @@ { "type": "HumanizeDom", "input": "
", - "expected": [["html.Element", "div", 0.0]] + "expected": [ + [ + "html.Element", + "div", + 0.0 + ] + ] } ] }, @@ -120,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 + ] ] } ] @@ -134,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 + ] ] } ] @@ -148,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" + ] + ] ] } ] @@ -173,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" + ] + ] ] } ] @@ -189,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" + ] + ] ] } ] @@ -206,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 + ] ] } ] @@ -222,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 + ] ] } ] @@ -235,7 +481,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":myns:div", 0.0]] + "expected": [ + [ + "html.Element", + ":myns:div", + 0.0 + ] + ] } ] }, @@ -246,7 +498,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":svg:svg", 0.0]] + "expected": [ + [ + "html.Element", + ":svg:svg", + 0.0 + ] + ] } ] }, @@ -258,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 + ] ] } ] @@ -276,7 +542,14 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", "input", 0.0, "#selfClosing"]] + "expected": [ + [ + "html.Element", + "input", + 0.0, + "#selfClosing" + ] + ] } ] }, @@ -287,7 +560,14 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", ":math:math", 0.0, "#selfClosing"]] + "expected": [ + [ + "html.Element", + ":math:math", + 0.0, + "#selfClosing" + ] + ] } ] }, @@ -299,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" + ] + ] ] } ] @@ -322,7 +639,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Element", "constructor", 0.0]] + "expected": [ + [ + "html.Element", + "constructor", + 0.0 + ] + ] } ] } @@ -343,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" + ] + ] ] } ] @@ -357,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" + ] + ] ] } ] @@ -371,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" + ] + ] ] } ] @@ -385,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" + ] + ] ] } ] @@ -400,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'" + ] + ] ] } ] @@ -414,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']" + ] ] ] } @@ -433,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)" + ] ] ] } @@ -452,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)" + ] ] ] } @@ -471,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()" + ] + ] ] } ] @@ -485,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)" + ] ] ] } @@ -509,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" + ] + ] ] } ] @@ -524,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" + ] ] ] } @@ -545,14 +1002,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "foo", "{{message}}", - [""], - ["{{", "message", "}}"], - [""] + [ + "" + ], + [ + "{{", + "message", + "}}" + ], + [ + "" + ] ] ] } @@ -571,8 +1040,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "&", [""], ["&", "&"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "foo", + "&", + [ + "" + ], + [ + "&", + "&" + ], + [ + "" + ] + ] ] } ] @@ -585,8 +1072,26 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "🛈", [""], ["🛈", "🛈"], [""]] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "foo", + "🛈", + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] + ] ] } ] @@ -599,38 +1104,30 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "foo", "🛈", [""], ["🛈", "🛈"], [""]] - ] - } - ] - }, - { - "name": "should parse attributes containing unquoted interpolation", - "path": "HtmlParser/parse/attributes/should parse attributes containing unquoted interpolation", - "assertions": [ - { - "type": "HumanizeDom", - "input": "
", - "expected": [ - ["html.Element", "div", 0.0], + [ + "html.Element", + "div", + 0.0 + ], [ "html.Attribute", "foo", - "{{message}}", - [""], - ["{{", "message", "}}"], - [""] + "🛈", + [ + "" + ], + [ + "🛈", + "🛈" + ], + [ + "" + ] ] ] } ] }, - { - "name": "should parse bound inputs with expressions containing newlines", - "path": "HtmlParser/parse/attributes/should parse bound inputs with expressions containing newlines", - "assertions": [] - }, { "name": "should decode HTML entities in interpolated attributes", "path": "HtmlParser/parse/attributes/should decode HTML entities in interpolated attributes", @@ -651,9 +1148,17 @@ "html.Attribute", "foo", "{{&}}", - [""], - ["{{", "&", "}}"], - [""], + [ + "" + ], + [ + "{{", + "&", + "}}" + ], + [ + "" + ], "foo=\"{{&}}\"" ] ], @@ -674,8 +1179,16 @@ "type": "HumanizeDom", "input": "
", "expected": [ - ["html.Element", "div", 0.0], - ["html.Attribute", "k", ""] + [ + "html.Element", + "div", + 0.0 + ], + [ + "html.Attribute", + "k", + "" + ] ] } ] @@ -688,8 +1201,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" + ] + ] ] } ] @@ -702,8 +1226,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" + ] + ] ] } ] @@ -716,8 +1251,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" + ] + ] ] } ] @@ -746,8 +1293,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 + ] ] } ] @@ -759,7 +1314,13 @@ { "type": "HumanizeDom", "input": "", - "expected": [["html.Comment", "line 1 \n line 2", 0.0]] + "expected": [ + [ + "html.Comment", + "line 1 \n line 2", + 0.0 + ] + ] } ] } @@ -770,8 +1331,8 @@ "groups": [], "tests": [ { - "name": "should parse out expansion forms", - "path": "HtmlParser/parse/expansion forms/should parse out expansion forms", + "name": "should parse out expansion forms (with multiple cases)", + "path": "HtmlParser/parse/expansion forms/should parse out expansion forms (with multiple cases)", "assertions": [] }, { @@ -790,8 +1351,8 @@ "assertions": [] }, { - "name": "should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set", - "path": "HtmlParser/parse/expansion forms/should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set", + "name": "should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set (escapedString:false)", + "path": "HtmlParser/parse/expansion forms/should not normalize line-endings in ICU expressions in external templates when `i18nNormalizeLineEndingsInICUs` is not set (escapedString:false)", "assertions": [] }, { @@ -863,10 +1424,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" + ] + ] ] } ] @@ -879,8 +1457,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" + ] ] } ] @@ -903,10 +1490,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" + ] ] } ] @@ -918,7 +1521,13 @@ { "type": "HumanizeDom", "input": "@defer{}", - "expected": [["html.Block", "defer", 0.0]] + "expected": [ + [ + "html.Block", + "defer", + 0.0 + ] + ] } ] }, @@ -930,8 +1539,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 + ] ] } ] @@ -944,15 +1561,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, + [ + " " + ] + ] ] } ] @@ -965,18 +1621,117 @@ "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 " + ] + ] + ] + } + ] + }, + { + "name": "should parse exhaustive default checks in a switch block", + "path": "HtmlParser/parse/blocks/should parse exhaustive default checks in a switch block", + "assertions": [ + { + "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 + ] ] } ] @@ -989,9 +1744,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" + ] + ] ] } ] @@ -1032,8 +1802,8 @@ "assertions": [] }, { - "name": "should parse an incomplete block with no parameters", - "path": "HtmlParser/parse/blocks/should parse an incomplete block with no parameters", + "name": "should parse an incomplete block with no body", + "path": "HtmlParser/parse/blocks/should parse an incomplete block with no body", "assertions": [] } ] @@ -1049,7 +1819,13 @@ { "type": "HumanizeDom", "input": "@let foo = 123;", - "expected": [["html.LetDeclaration", "foo", "123"]] + "expected": [ + [ + "html.LetDeclaration", + "foo", + "123" + ] + ] } ] }, @@ -1061,10 +1837,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" + ] ] } ] @@ -1324,11 +2115,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 } @@ -1369,9 +2197,17 @@ "html.Text", " pre {{ value }} post ", 1.0, - [" pre "], - ["{{", " value ", "}}"], - [" post "], + [ + " pre " + ], + [ + "{{", + " value ", + "}}" + ], + [ + " post " + ], " pre {{ value }} post " ] ], @@ -1387,8 +2223,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 } @@ -1402,9 +2252,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 } @@ -1417,7 +2288,16 @@ { "type": "HumanizeDomSourceSpans", "input": "
", - "expected": [["html.Element", "br", 0.0, "
", "
", null]], + "expected": [ + [ + "html.Element", + "br", + 0.0, + "
", + "
", + null + ] + ], "options": null } ] @@ -1430,7 +2310,15 @@ "type": "HumanizeDomSourceSpans", "input": "
", "expected": [ - ["html.Element", "br", 0.0, "
", "#selfClosing", "
", "
"] + [ + "html.Element", + "br", + 0.0, + "
", + "#selfClosing", + "
", + "
" + ] ], "options": null } @@ -1444,8 +2332,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 } @@ -1468,13 +2371,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" + ] } } ] @@ -1487,8 +2428,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 }, @@ -1496,11 +2451,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 } @@ -1522,8 +2514,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 } @@ -1665,4 +2668,4 @@ "tests": [] } ] -} +} \ No newline at end of file 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 90e5919eb..1eb249b33 100644 --- a/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_html_whitespaces_spec.json @@ -1,6 +1,6 @@ { "name": "html_whitespaces_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/html_whitespaces_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/html_whitespaces_spec.ts", "test_groups": [ { "name": "removeWhitespaces", @@ -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 } @@ -315,4 +589,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json b/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json index e31eb2f97..091374293 100644 --- a/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json +++ b/crates/angular_conformance/fixtures/ml_parser_lexer_spec.json @@ -1,6 +1,6 @@ { "name": "lexer_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/lexer_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/ml_parser/lexer_spec.ts", "test_groups": [ { "name": "HtmlLexer", @@ -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,12 @@ "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 +537,22 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.CDATA_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.CDATA_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -375,7 +566,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,16 +672,46 @@ "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 } @@ -471,12 +726,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 +770,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 +806,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 +842,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 +878,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 +904,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 +938,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 +996,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 +1032,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 +1074,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 +1108,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 +1148,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 +1203,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,18 +1237,43 @@ "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"] - ], - "options": null - } - ] + [ + "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 + } + ] }, { "name": "should produce spans for directives", @@ -787,11 +1300,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 +1334,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 +1377,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 +1411,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 +1445,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 +1485,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 +1519,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 } @@ -961,8 +1596,8 @@ "assertions": [] }, { - "name": "should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined", - "path": "HtmlLexer/open tags/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined", + "name": "should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapedString:false)", + "path": "HtmlLexer/open tags/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined (escapedString:false)", "assertions": [] }, { @@ -986,23 +1621,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 +1701,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 +1761,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 +1839,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 +1925,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 +1994,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,23 +2056,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, @@ -1301,11 +2203,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 +2242,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 +2264,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 +2286,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 +2308,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 +2330,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 +2353,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 +2384,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 +2406,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 +2428,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 +2450,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 +2473,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 +2500,11 @@ "type": "HtmlLexerTest", "input": "\\0", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1507,7 +2518,11 @@ "type": "HtmlLexerTest", "input": "\\09", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -1528,8 +2543,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 +2570,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 +2598,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 +2617,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 +2636,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 +2661,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 +2689,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 +2714,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 +2742,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 +2767,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 +2789,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 +2817,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 +2846,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 +2874,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 +2915,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 +2956,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 +3061,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 +3086,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 +3111,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 +3136,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 +3161,18 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -1990,10 +3193,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 +3310,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 +3338,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 +3376,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 +3398,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,10 +3436,20 @@ "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 }, @@ -2188,10 +3458,20 @@ "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 +3486,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 +3508,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 +3530,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 +3562,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 +3575,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 +3597,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 +3619,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 +3647,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 +3675,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 +3700,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 +3719,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 +3738,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 +3763,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 +3785,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 +3810,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 +3829,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 +3848,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 +3873,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 +3910,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 +3940,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 +4046,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 +4091,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 +4142,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,10 +4172,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 } @@ -2597,13 +4202,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 +4244,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 +4286,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 +4320,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 +4364,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,37 +4406,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"] - ], - "options": null - } - ] - }, - { - "name": "should parse bound inputs with expressions containing newlines", - "path": "HtmlLexer/attributes/should parse bound inputs with expressions containing newlines", - "assertions": [ - { - "type": "HtmlLexerTest", - "input": "", - "test_type": "HumanizeParts", - "expected": [ - ["TokenType.TAG_OPEN_START", "", "app-component"], - ["TokenType.ATTR_NAME", "", "[attr]"], - ["TokenType.ATTR_QUOTE", "\""], + [ + "TokenType.TAG_OPEN_START", + "", + "t" + ], + [ + "TokenType.ATTR_NAME", + "", + "a" + ], + [ + "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.ATTR_QUOTE", "\""], - ["TokenType.TAG_OPEN_END"], - ["TokenType.EOF"] + [ + "TokenType.TAG_OPEN_END" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -2748,11 +4448,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 } @@ -2767,17 +4482,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 } @@ -2792,17 +4542,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 } @@ -2817,13 +4601,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 } @@ -2838,13 +4643,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 } @@ -2859,11 +4685,26 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_OPEN_START", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_OPEN_START", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -2877,7 +4718,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 }, @@ -2949,10 +4863,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 }, @@ -2961,13 +4887,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 } @@ -2982,13 +4929,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 }, @@ -2997,10 +4965,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 } @@ -3015,11 +4995,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 } @@ -3039,7 +5036,16 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TAG_CLOSE", + "", + "test" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3052,7 +5058,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 } ] @@ -3065,7 +5080,16 @@ "type": "HtmlLexerTest", "input": "", "test_type": "HumanizeParts", - "expected": [["TokenType.TAG_CLOSE", "", "test"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TAG_CLOSE", + "", + "test" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3079,8 +5103,14 @@ "input": "", "test_type": "HumanizeSourceSpans", "expected": [ - ["TokenType.TAG_CLOSE", ""], - ["TokenType.EOF", ""] + [ + "TokenType.TAG_CLOSE", + "" + ], + [ + "TokenType.EOF", + "" + ] ], "options": null } @@ -3094,7 +5124,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 }, @@ -3498,7 +5871,15 @@ "type": "HtmlLexerTest", "input": "< a>", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "< a>"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "< a>" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -3512,17 +5893,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 } @@ -3537,14 +5951,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 } @@ -3559,13 +5994,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 } @@ -3580,14 +6037,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 } @@ -3602,13 +6080,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, @@ -3630,9 +6131,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 }, @@ -3641,9 +6151,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 } @@ -3658,13 +6177,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 }, @@ -3673,13 +6214,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 } @@ -3694,10 +6257,23 @@ "input": "{{ \"{\" }}", "test_type": "HumanizeParts", "expected": [ - ["TokenType.TEXT", ""], - ["TokenType.INTERPOLATION", "{{", " \"{\" ", "}}"], - ["TokenType.TEXT", ""], - ["TokenType.EOF"] + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.INTERPOLATION", + "{{", + " \"{\" ", + "}}" + ], + [ + "TokenType.TEXT", + "" + ], + [ + "TokenType.EOF" + ] ], "options": null } @@ -3712,10 +6288,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 +6319,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 } @@ -3748,11 +6349,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, @@ -3780,11 +6396,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 } @@ -3799,11 +6430,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 } @@ -3818,11 +6464,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 } @@ -3837,11 +6498,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 } @@ -3856,11 +6532,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 } @@ -3881,11 +6572,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 } @@ -3900,13 +6606,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 } @@ -3921,11 +6649,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 } @@ -3940,11 +6683,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 } @@ -3959,11 +6717,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 } @@ -3984,11 +6757,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 } @@ -4003,14 +6791,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 } @@ -4055,8 +6868,8 @@ "assertions": [] }, { - "name": "should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined", - "path": "HtmlLexer/expansion forms/[line ending normalization/{escapedString: false}/should not normalize line-endings in ICU expressions when `i18nNormalizeLineEndingsInICUs` is not defined", + "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": [] }, { @@ -4080,23 +6893,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, @@ -4118,17 +6973,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, @@ -4150,21 +7033,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, @@ -4186,23 +7111,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, @@ -4224,19 +7197,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, @@ -4258,17 +7266,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, @@ -4290,23 +7328,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, @@ -4395,11 +7475,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 } @@ -4419,7 +7514,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, @@ -4433,7 +7536,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, @@ -4447,7 +7558,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, @@ -4461,7 +7580,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, @@ -4475,7 +7602,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, @@ -4490,10 +7625,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, @@ -4508,7 +7656,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, @@ -4522,7 +7678,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, @@ -4536,7 +7700,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, @@ -4550,7 +7722,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, @@ -4565,8 +7745,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, @@ -4587,7 +7772,11 @@ "type": "HtmlLexerTest", "input": "\\0", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4601,7 +7790,11 @@ "type": "HtmlLexerTest", "input": "\\09", "test_type": "HumanizeParts", - "expected": [["TokenType.EOF"]], + "expected": [ + [ + "TokenType.EOF" + ] + ], "options": { "tokenize_expansion_forms": false, "interpolation_config": null, @@ -4622,8 +7815,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, @@ -4644,7 +7842,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, @@ -4664,7 +7870,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, @@ -4678,7 +7889,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, @@ -4692,7 +7908,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, @@ -4712,7 +7933,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, @@ -4732,7 +7961,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, @@ -4752,7 +7986,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, @@ -4772,7 +8014,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, @@ -4792,7 +8039,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, @@ -4806,7 +8061,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, @@ -4826,7 +8089,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, @@ -4846,7 +8117,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, @@ -4867,11 +8146,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, @@ -4893,11 +8187,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, @@ -4919,17 +8228,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, @@ -5010,6 +8353,60 @@ } ] }, + { + "name": "should parse @default never;", + "path": "HtmlLexer/blocks/should parse @default never;", + "assertions": [ + { + "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 + } + ] + }, + { + "name": "should parse @default never ;", + "path": "HtmlLexer/blocks/should parse @default never ;", + "assertions": [ + { + "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 + } + ] + }, { "name": "should parse a block with parameters", "path": "HtmlLexer/blocks/should parse a block with parameters", @@ -5019,13 +8416,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 } @@ -5040,12 +8455,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 } @@ -5060,11 +8490,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 }, @@ -5073,12 +8515,27 @@ "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 } @@ -5127,12 +8584,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 } @@ -5147,11 +8619,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 } @@ -5166,12 +8650,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 } @@ -5191,13 +8690,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 } @@ -5212,9 +8729,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 } @@ -5229,10 +8754,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 } @@ -5246,14 +8781,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 } ] @@ -5267,11 +8812,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 } @@ -5286,12 +8844,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 } @@ -5306,12 +8879,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 } @@ -5326,17 +8914,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 } @@ -5351,22 +8970,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 } @@ -5381,14 +9048,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 } @@ -5413,13 +9105,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 } @@ -5434,10 +9146,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 } @@ -5452,9 +9175,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 } @@ -5469,10 +9200,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 } @@ -5487,11 +9229,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 } @@ -5505,7 +9261,15 @@ "type": "HtmlLexerTest", "input": "@", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5518,7 +9282,15 @@ "type": "HtmlLexerTest", "input": " @", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", " @"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + " @" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5531,7 +9303,15 @@ "type": "HtmlLexerTest", "input": "@ ", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@ "], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@ " + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5544,7 +9324,15 @@ "type": "HtmlLexerTest", "input": "@\nfoo", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@\nfoo"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@\nfoo" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5557,7 +9345,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 } ] @@ -5570,7 +9366,15 @@ "type": "HtmlLexerTest", "input": "@ if", "test_type": "HumanizeParts", - "expected": [["TokenType.TEXT", "@ if"], ["TokenType.EOF"]], + "expected": [ + [ + "TokenType.TEXT", + "@ if" + ], + [ + "TokenType.EOF" + ] + ], "options": null } ] @@ -5581,4 +9385,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/output_abstract_emitter_node_only_spec.json b/crates/angular_conformance/fixtures/output_abstract_emitter_node_only_spec.json index 51ccdc4b7..41e0ce620 100644 --- a/crates/angular_conformance/fixtures/output_abstract_emitter_node_only_spec.json +++ b/crates/angular_conformance/fixtures/output_abstract_emitter_node_only_spec.json @@ -1,9 +1,9 @@ { "name": "abstract_emitter_node_only_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/output/abstract_emitter_node_only_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/output/abstract_emitter_node_only_spec.ts", "test_groups": [ { - "name": "AbstractEmitter", + "name": "AbstractEmitter (node only)", "groups": [ { "name": "EmitterVisitorContext", @@ -11,42 +11,42 @@ "tests": [ { "name": "should add source files to the source map", - "path": "AbstractEmitter/EmitterVisitorContext/should add source files to the source map", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should add source files to the source map", "assertions": [] }, { "name": "should generate a valid mapping", - "path": "AbstractEmitter/EmitterVisitorContext/should generate a valid mapping", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should generate a valid mapping", "assertions": [] }, { "name": "should be able to shift the content", - "path": "AbstractEmitter/EmitterVisitorContext/should be able to shift the content", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should be able to shift the content", "assertions": [] }, { "name": "should use the default source file for the first character", - "path": "AbstractEmitter/EmitterVisitorContext/should use the default source file for the first character", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should use the default source file for the first character", "assertions": [] }, { "name": "should use an explicit mapping for the first character", - "path": "AbstractEmitter/EmitterVisitorContext/should use an explicit mapping for the first character", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should use an explicit mapping for the first character", "assertions": [] }, { "name": "should map leading segment without span", - "path": "AbstractEmitter/EmitterVisitorContext/should map leading segment without span", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should map leading segment without span", "assertions": [] }, { "name": "should handle indent", - "path": "AbstractEmitter/EmitterVisitorContext/should handle indent", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should handle indent", "assertions": [] }, { "name": "should coalesce identical span", - "path": "AbstractEmitter/EmitterVisitorContext/should coalesce identical span", + "path": "AbstractEmitter (node only)/EmitterVisitorContext/should coalesce identical span", "assertions": [] } ] @@ -55,4 +55,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json b/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json index 8e1a4152c..bdf58af49 100644 --- a/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json +++ b/crates/angular_conformance/fixtures/output_abstract_emitter_spec.json @@ -1,6 +1,6 @@ { "name": "abstract_emitter_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/output/abstract_emitter_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/output/abstract_emitter_spec.ts", "test_groups": [ { "name": "AbstractEmitter", @@ -55,4 +55,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/output_output_jit_spec.json b/crates/angular_conformance/fixtures/output_output_jit_spec.json index 3fe4a45b2..fec40741d 100644 --- a/crates/angular_conformance/fixtures/output_output_jit_spec.json +++ b/crates/angular_conformance/fixtures/output_output_jit_spec.json @@ -1,6 +1,6 @@ { "name": "output_jit_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/output/output_jit_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/output/output_jit_spec.ts", "test_groups": [ { "name": "Output JIT", @@ -31,4 +31,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/output_source_map_spec.json b/crates/angular_conformance/fixtures/output_source_map_spec.json index 78fe394f9..7ffac1bea 100644 --- a/crates/angular_conformance/fixtures/output_source_map_spec.json +++ b/crates/angular_conformance/fixtures/output_source_map_spec.json @@ -1,6 +1,6 @@ { "name": "source_map_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/output/source_map_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/output/source_map_spec.ts", "test_groups": [ { "name": "source map generation", @@ -72,4 +72,4 @@ "tests": [] } ] -} +} \ No newline at end of file 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 bb0dcdb0a..a4f0322ad 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 @@ -1,6 +1,6 @@ { "name": "r3_ast_absolute_span_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_ast_absolute_span_spec.ts", "test_groups": [ { "name": "expression AST absolute source spans", @@ -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, @@ -837,8 +1041,8 @@ "assertions": [] }, { - "name": "is correct for variables and placeholders", - "path": "expression AST absolute source spans/ICU expressions/is correct for variables and placeholders", + "name": "is correct for variables and placeholders in nested ICUs", + "path": "expression AST absolute source spans/ICU expressions/is correct for variables and placeholders in nested ICUs", "assertions": [] } ] @@ -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, @@ -1078,4 +1334,4 @@ ] } ] -} +} \ No newline at end of file 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 1793f7c79..8d951e662 100644 --- a/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_ast_spans_spec.json @@ -1,6 +1,6 @@ { "name": "r3_ast_spans_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_ast_spans_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_ast_spans_spec.ts", "test_groups": [ { "name": "R3 AST source spans", @@ -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}}\"", "prop", "{{v}}"] + [ + "BoundAttribute", + "data-prop=\"{{v}}\"", + "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 @@ "", "" ], - ["Reference", "data-ref-a", "a", ""] + [ + "Reference", + "data-ref-a", + "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 @@ "", "" ], - ["Variable", "data-let-a=\"b\"", "a", "b"] + [ + "Variable", + "data-let-a=\"b\"", + "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 @@ "
    ", "
    " ], - ["BoundEvent", "data-on-event=\"v\"", "event", "v"] + [ + "BoundEvent", + "data-on-event=\"v\"", + "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,8 +950,18 @@ "
    ", "
    " ], - ["BoundAttribute", "data-bindon-prop=\"v\"", "prop", "v"], - ["BoundEvent", "data-bindon-prop=\"v\"", "prop", "v"] + [ + "BoundAttribute", + "data-bindon-prop=\"v\"", + "prop", + "v" + ], + [ + "BoundEvent", + "data-bindon-prop=\"v\"", + "prop", + "v" + ] ], "ignore_error": false } @@ -696,7 +981,12 @@ "
    ", "
    " ], - ["BoundEvent", "(@name.done)=\"v\"", "name.done", "v"] + [ + "BoundEvent", + "(@name.done)=\"v\"", + "name.done", + "v" + ] ], "ignore_error": false } @@ -716,8 +1006,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "#a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "#a", + "a", + "" + ] ], "ignore_error": false } @@ -731,8 +1031,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "#a=\"b\"", "a", "b"] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "#a=\"b\"", + "a", + "b" + ] ], "ignore_error": false } @@ -746,8 +1056,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "ref-a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "ref-a", + "a", + "" + ] ], "ignore_error": false } @@ -761,8 +1081,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Reference", "ref-a", "a", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Reference", + "ref-a", + "a", + "" + ] ], "ignore_error": false } @@ -788,9 +1118,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 } @@ -814,10 +1153,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 } @@ -843,41 +1194,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 } @@ -903,18 +1309,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 } @@ -939,12 +1389,72 @@ "@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 + } + ] + }, + { + "name": "is correct for switch blocks with exhaustive checking", + "path": "R3 AST source spans/switch blocks/is correct for switch blocks with exhaustive checking", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "@switch (cond.kind) {@case (x()) {X case}@default never;}", + "expected": [ + [ + "SwitchBlock", + "@switch (cond.kind) {@case (x()) {X case}@default never;}", + "@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;" + ] ], "ignore_error": false } @@ -970,19 +1480,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 } @@ -1013,16 +1583,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 } @@ -1041,7 +1629,14 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123;", - "expected": [["LetDeclaration", "@let foo = 123", "foo", "123"]], + "expected": [ + [ + "LetDeclaration", + "@let foo = 123", + "foo", + "123" + ] + ], "ignore_error": false } ] @@ -1059,7 +1654,14 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Component", "", "", ""]], + "expected": [ + [ + "Component", + "", + "", + "" + ] + ], "ignore_error": true } ] @@ -1071,7 +1673,14 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Component", "", "", ""]], + "expected": [ + [ + "Component", + "", + "", + "" + ] + ], "ignore_error": true } ] @@ -1109,14 +1718,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 } @@ -1147,15 +1794,28 @@ "
    ", "
    " ], - ["Text", "Hello: "], + [ + "Text", + "Hello: " + ], [ "Component", "", "", "" ], - ["Element", "", "", ""], - ["Component", "", "", ""] + [ + "Element", + "", + "", + "" + ], + [ + "Component", + "", + "", + "" + ] ], "ignore_error": true } @@ -1175,8 +1835,18 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "
    ", "
    ", "
    "], - ["Directive", "@Dir", "@Dir", ""] + [ + "Element", + "
    ", + "
    ", + "
    " + ], + [ + "Directive", + "@Dir", + "@Dir", + "" + ] ], "ignore_error": true } @@ -1196,10 +1866,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 } @@ -1219,13 +1909,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 } @@ -1237,4 +1962,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/render3_r3_ast_visitor_spec.json b/crates/angular_conformance/fixtures/render3_r3_ast_visitor_spec.json new file mode 100644 index 000000000..e17745a73 --- /dev/null +++ b/crates/angular_conformance/fixtures/render3_r3_ast_visitor_spec.json @@ -0,0 +1,17 @@ +{ + "name": "r3_ast_visitor_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_ast_visitor_spec.ts", + "test_groups": [ + { + "name": "RecursiveVisitor", + "groups": [], + "tests": [ + { + "name": "should not mutate IfBlockBranch children when visiting", + "path": "RecursiveVisitor/should not mutate IfBlockBranch children when visiting", + "assertions": [] + } + ] + } + ] +} \ No newline at end of file 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 14f06f3e8..e8e486d8a 100644 --- a/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json +++ b/crates/angular_conformance/fixtures/render3_r3_template_transform_spec.json @@ -1,6 +1,6 @@ { "name": "r3_template_transform_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_template_transform_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/r3_template_transform_spec.ts", "test_groups": [ { "name": "R3 template transform", @@ -27,7 +27,12 @@ { "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "a"], - ["Element", "span"] + [ + "Element", + "a" + ], + [ + "Element", + "span" + ] ], "ignore_error": true } @@ -54,7 +65,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -67,8 +83,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "a", "b"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "a", + "b" + ] ], "ignore_error": false } @@ -87,8 +110,15 @@ "type": "ExpectFromHtml", "input": " \n ", "expected": [ - ["Content", "a"], - ["TextAttribute", "select", "a"] + [ + "Content", + "a" + ], + [ + "TextAttribute", + "select", + "a" + ] ], "ignore_error": false } @@ -102,9 +132,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 +168,12 @@ { "type": "ExpectFromHtml", "input": "{{a}}", - "expected": [["BoundText", "{{ a }}"]], + "expected": [ + [ + "BoundText", + "{{ a }}" + ] + ], "ignore_error": false } ] @@ -147,8 +192,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "someProp", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "someProp", + "v" + ] ], "ignore_error": false } @@ -162,8 +215,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "prop", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "prop", + "v" + ] ], "ignore_error": false } @@ -182,8 +243,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "prop", "{{ v }}"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "prop", + "{{ v }}" + ] ], "ignore_error": false } @@ -197,8 +266,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "some-prop", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "some-prop", + "v" + ] ], "ignore_error": false } @@ -212,8 +289,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "d.ot", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "d.ot", + "v" + ] ], "ignore_error": false } @@ -227,8 +312,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 0, "mappedAttr", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 0, + "mappedAttr", + "v" + ] ], "ignore_error": false } @@ -242,8 +335,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 1, "someAttr", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 1, + "someAttr", + "v" + ] ], "ignore_error": false } @@ -257,8 +358,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 2, "some-class", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 2, + "some-class", + "v" + ] ], "ignore_error": false } @@ -272,8 +381,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 2, "someClass", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 2, + "someClass", + "v" + ] ], "ignore_error": false } @@ -287,8 +404,16 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundAttribute", 3, "someStyle", "v"] + [ + "Element", + "div" + ], + [ + "BoundAttribute", + 3, + "someStyle", + "v" + ] ], "ignore_error": false } @@ -302,11 +427,34 @@ "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 } @@ -326,8 +474,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "animate.enter", "foo"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "animate.enter", + "foo" + ] ], "ignore_error": false }, @@ -335,8 +490,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 +507,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 +531,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "animate.leave", "foo"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "animate.leave", + "foo" + ] ], "ignore_error": false }, @@ -368,8 +547,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 +564,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 +582,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 +611,20 @@ { "type": "ExpectFromHtml", "input": "
    ", - "expected": [["Template"], ["TextAttribute", "ngIf", ""], ["Element", "div"]], + "expected": [ + [ + "Template" + ], + [ + "TextAttribute", + "ngIf", + "" + ], + [ + "Element", + "div" + ] + ], "ignore_error": false } ] @@ -418,7 +636,11 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"]], + "expected": [ + [ + "Template" + ] + ], "ignore_error": false } ] @@ -430,7 +652,15 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Element", ":svg:svg"], ["Template"]], + "expected": [ + [ + "Element", + ":svg:svg" + ], + [ + "Template" + ] + ], "ignore_error": false } ] @@ -442,7 +672,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 +697,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Reference", "a", ""]], + "expected": [ + [ + "Template" + ], + [ + "Reference", + "a", + "" + ] + ], "ignore_error": false } ] @@ -466,7 +718,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Reference", "a", ""]], + "expected": [ + [ + "Template" + ], + [ + "Reference", + "a", + "" + ] + ], "ignore_error": false } ] @@ -483,7 +744,16 @@ { "type": "ExpectFromHtml", "input": "", - "expected": [["Template"], ["Variable", "a", "b"]], + "expected": [ + [ + "Template" + ], + [ + "Variable", + "a", + "b" + ] + ], "ignore_error": false } ] @@ -496,9 +766,19 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Template"], - ["TextAttribute", "k1", "v1"], - ["TextAttribute", "k2", "v2"] + [ + "Template" + ], + [ + "TextAttribute", + "k1", + "v1" + ], + [ + "TextAttribute", + "k2", + "v2" + ] ], "ignore_error": false } @@ -512,9 +792,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 +826,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 +856,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 +888,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 +918,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 +955,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "event", "window", "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "event", + "window", + "v" + ] ], "ignore_error": false } @@ -618,8 +979,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 +997,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "someEvent", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "someEvent", + null, + "v" + ] ], "ignore_error": false } @@ -642,8 +1021,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 0, "event", null, "v"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 0, + "event", + null, + "v" + ] ], "ignore_error": false } @@ -662,9 +1050,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 +1080,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 +1110,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 +1140,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 +1170,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 +1200,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 +1260,17 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["BoundEvent", 1, "", null, "onAnimationEvent($event)"] + [ + "Element", + "div" + ], + [ + "BoundEvent", + 1, + "", + null, + "onAnimationEvent($event)" + ] ], "ignore_error": true } @@ -830,8 +1311,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "a", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "a", + "" + ] ], "ignore_error": false } @@ -845,8 +1333,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "a", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "a", + "" + ] ], "ignore_error": false } @@ -860,8 +1355,15 @@ "type": "ExpectFromHtml", "input": "
    ", "expected": [ - ["Element", "div"], - ["Reference", "someA", ""] + [ + "Element", + "div" + ], + [ + "Reference", + "someA", + "" + ] ], "ignore_error": false } @@ -953,7 +1455,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -965,7 +1472,12 @@ { "type": "ExpectFromHtml", "input": "a", - "expected": [["Text", "a"]], + "expected": [ + [ + "Text", + "a" + ] + ], "ignore_error": false } ] @@ -984,9 +1496,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 }, @@ -994,9 +1517,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,8 +1544,15 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "rel", "stylesheet"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "rel", + "stylesheet" + ] ], "ignore_error": false }, @@ -1019,8 +1560,15 @@ "type": "ExpectFromHtml", "input": "", "expected": [ - ["Element", "link"], - ["TextAttribute", "REL", "stylesheet"] + [ + "Element", + "link" + ], + [ + "TextAttribute", + "REL", + "stylesheet" + ] ], "ignore_error": false } @@ -1058,9 +1606,19 @@ "type": "ExpectFromHtml", "input": "
    {{b}}
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "{{b}}"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "{{b}}" + ] ], "ignore_error": false } @@ -1074,10 +1632,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 } @@ -1091,11 +1662,21 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] - ], - "ignore_error": false + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] + ], + "ignore_error": false } ] }, @@ -1107,9 +1688,19 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] ], "ignore_error": false } @@ -1123,9 +1714,19 @@ "type": "ExpectFromHtml", "input": "
    a
    ", "expected": [ - ["Element", "div"], - ["TextAttribute", "ngNonBindable", ""], - ["Text", "a"] + [ + "Element", + "div" + ], + [ + "TextAttribute", + "ngNonBindable", + "" + ], + [ + "Text", + "a" + ] ], "ignore_error": false } @@ -1386,7 +1987,15 @@ { "type": "ExpectFromHtml", "input": "@defer{hello}", - "expected": [["DeferredBlock"], ["Text", "hello"]], + "expected": [ + [ + "DeferredBlock" + ], + [ + "Text", + "hello" + ] + ], "ignore_error": false } ] @@ -1399,9 +2008,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 } @@ -1414,7 +2031,18 @@ { "type": "ExpectFromHtml", "input": "@defer (on idle){hello}", - "expected": [["DeferredBlock"], ["IdleDeferredTrigger"], ["Text", "hello"]], + "expected": [ + [ + "DeferredBlock" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] + ], "ignore_error": false } ] @@ -1427,10 +2055,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 } @@ -1444,11 +2082,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 } @@ -1462,12 +2112,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 } @@ -1481,12 +2147,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 } @@ -1500,9 +2182,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 } @@ -1516,9 +2206,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 } @@ -1532,9 +2230,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 } @@ -1548,9 +2254,17 @@ "type": "ExpectFromHtml", "input": "@defer (on hover(button)){hello}", "expected": [ - ["DeferredBlock"], - ["HoverDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "HoverDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1564,9 +2278,17 @@ "type": "ExpectFromHtml", "input": "@defer (on interaction(button)){hello}", "expected": [ - ["DeferredBlock"], - ["InteractionDeferredTrigger", "button"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "InteractionDeferredTrigger", + "button" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1580,15 +2302,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 } @@ -1602,15 +2350,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 } @@ -1629,11 +2403,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 } @@ -1647,11 +2439,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 } @@ -1665,12 +2474,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 } @@ -1684,12 +2509,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 } @@ -1703,10 +2544,19 @@ "type": "ExpectFromHtml", "input": "@defer (on idle; hydrate never){hello}", "expected": [ - ["DeferredBlock"], - ["NeverDeferredTrigger"], - ["IdleDeferredTrigger"], - ["Text", "hello"] + [ + "DeferredBlock" + ], + [ + "NeverDeferredTrigger" + ], + [ + "IdleDeferredTrigger" + ], + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1720,13 +2570,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 } @@ -1740,12 +2609,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 } @@ -1759,60 +2644,164 @@ "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 :("] - ], - "ignore_error": false - } - ] - }, - { - "name": "should treat blocks as plain text inside ngNonBindable", - "path": "R3 template transform/deferred blocks/should treat blocks as plain text inside ngNonBindable", - "assertions": [ - { - "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", ""], [ - "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){" + "DeferredBlock" ], - ["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 - } + [ + "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 + } + ] + }, + { + "name": "should treat blocks as plain text inside ngNonBindable", + "path": "R3 template transform/deferred blocks/should treat blocks as plain text inside ngNonBindable", + "assertions": [ + { + "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", + "" + ], + [ + "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", + "}" + ] + ], + "ignore_error": false + } ] }, { @@ -1823,16 +2812,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 } @@ -1846,13 +2864,18 @@ "type": "ExpectFromHtml", "input": "@defer (on viewport({trigger: foo, rootMargin: \"123px\", threshold: [1, 2, 3]})){hello}", "expected": [ - ["DeferredBlock"], + [ + "DeferredBlock" + ], [ "ViewportDeferredTrigger", "foo", "{rootMargin: \"123px\", threshold: [1, 2, 3]}" ], - ["Text", "hello"] + [ + "Text", + "hello" + ] ], "ignore_error": false } @@ -1866,9 +2889,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 }, @@ -1876,9 +2908,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 } @@ -1942,6 +2983,26 @@ "name": "should report if a default block has parameters", "path": "R3 template transform/switch blocks/validations/should report if a default block has parameters", "assertions": [] + }, + { + "name": "should report if in a @switch block a @default never block has a body", + "path": "R3 template transform/switch blocks/validations/should report if in a @switch block a @default never block has a body", + "assertions": [] + }, + { + "name": "should report if a switch fallthrough case is followed by a @default never block", + "path": "R3 template transform/switch blocks/validations/should report if a switch fallthrough case is followed by a @default never block", + "assertions": [] + }, + { + "name": "should throw if @default never is not the last case in a switch block", + "path": "R3 template transform/switch blocks/validations/should throw if @default never is not the last case in a switch block", + "assertions": [] + }, + { + "name": "should throw if a semicolon is missing after @default never", + "path": "R3 template transform/switch blocks/validations/should throw if a semicolon is missing after @default never", + "assertions": [] } ] } @@ -1955,20 +3016,78 @@ "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 + } + ] + }, + { + "name": "should parse a switch block with a default never case", + "path": "R3 template transform/switch blocks/should parse a switch block with a default never case", + "assertions": [ + { + "type": "ExpectFromHtml", + "input": "\n @switch (cond.kind) {\n @default never;\n }\n ", + "expected": [ + [ + "SwitchBlock", + "cond.kind" + ], + [ + "SwitchExhaustiveCheck" + ] ], "ignore_error": false } @@ -1987,20 +3106,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 } @@ -2014,41 +3171,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 } @@ -2062,13 +3313,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 } @@ -2082,19 +3352,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 } @@ -2211,17 +3517,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 } @@ -2235,15 +3581,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 }, @@ -2251,15 +3632,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 }, @@ -2267,15 +3683,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 } @@ -2289,21 +3740,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 } @@ -2317,21 +3827,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 } @@ -2345,28 +3914,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 } @@ -2380,15 +4030,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 } @@ -2420,15 +4105,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 } @@ -2525,14 +4245,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 } @@ -2546,13 +4290,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 } @@ -2566,23 +4330,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 } @@ -2596,12 +4408,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 } @@ -2615,12 +4445,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 } @@ -2634,14 +4482,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 } @@ -2655,13 +4527,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 } @@ -2680,7 +4574,13 @@ { "type": "ExpectFromHtml", "input": "@let foo = 123 + 456;", - "expected": [["LetDeclaration", "foo", "123 + 456"]], + "expected": [ + [ + "LetDeclaration", + "foo", + "123 + 456" + ] + ], "ignore_error": false } ] @@ -2703,9 +4603,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 } @@ -2862,4 +4772,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/render3_style_parser_spec.json b/crates/angular_conformance/fixtures/render3_style_parser_spec.json index 9894156f6..318f8c2a5 100644 --- a/crates/angular_conformance/fixtures/render3_style_parser_spec.json +++ b/crates/angular_conformance/fixtures/render3_style_parser_spec.json @@ -1,6 +1,6 @@ { "name": "style_parser_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/style_parser_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/style_parser_spec.ts", "test_groups": [ { "name": "style parsing", @@ -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,11 +205,14 @@ { "type": "ParseStyle", "input": "borderWidth: 200px", - "expected": ["border-width", "200px"] + "expected": [ + "border-width", + "200px" + ] } ] } ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/render3_view_binding_spec.json b/crates/angular_conformance/fixtures/render3_view_binding_spec.json index 1b0ba4ad0..8ced1051c 100644 --- a/crates/angular_conformance/fixtures/render3_view_binding_spec.json +++ b/crates/angular_conformance/fixtures/render3_view_binding_spec.json @@ -1,6 +1,6 @@ { "name": "binding_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/binding_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/binding_spec.ts", "test_groups": [ { "name": "findMatchingDirectivesAndPipes", @@ -346,4 +346,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/render3_view_i18n_spec.json b/crates/angular_conformance/fixtures/render3_view_i18n_spec.json index befe0e926..ddf594cd1 100644 --- a/crates/angular_conformance/fixtures/render3_view_i18n_spec.json +++ b/crates/angular_conformance/fixtures/render3_view_i18n_spec.json @@ -1,6 +1,6 @@ { "name": "i18n_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/i18n_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/i18n_spec.ts", "test_groups": [ { "name": "Utils", @@ -220,4 +220,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/render3_view_parse_template_options_spec.json b/crates/angular_conformance/fixtures/render3_view_parse_template_options_spec.json index 6c30a0b3f..bb8b14d28 100644 --- a/crates/angular_conformance/fixtures/render3_view_parse_template_options_spec.json +++ b/crates/angular_conformance/fixtures/render3_view_parse_template_options_spec.json @@ -1,6 +1,6 @@ { "name": "parse_template_options_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/parse_template_options_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/render3/view/parse_template_options_spec.ts", "test_groups": [ { "name": "collectCommentNodes", @@ -14,4 +14,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/schema_dom_element_schema_registry_spec.json b/crates/angular_conformance/fixtures/schema_dom_element_schema_registry_spec.json index f5fbb6522..94fd617c7 100644 --- a/crates/angular_conformance/fixtures/schema_dom_element_schema_registry_spec.json +++ b/crates/angular_conformance/fixtures/schema_dom_element_schema_registry_spec.json @@ -1,6 +1,6 @@ { "name": "dom_element_schema_registry_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/schema/dom_element_schema_registry_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/schema/dom_element_schema_registry_spec.ts", "test_groups": [ { "name": "DOMElementSchema", @@ -150,11 +150,6 @@ "path": "DOMElementSchema/should check security contexts for attributes", "assertions": [] }, - { - "name": "generate a new schema", - "path": "DOMElementSchema/generate a new schema", - "assertions": [] - }, { "name": "should support aria property if attribute is also supported", "path": "DOMElementSchema/should support aria property if attribute is also supported", @@ -163,4 +158,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/schema_trusted_types_sinks_spec.json b/crates/angular_conformance/fixtures/schema_trusted_types_sinks_spec.json index 837e0fb03..20a65159c 100644 --- a/crates/angular_conformance/fixtures/schema_trusted_types_sinks_spec.json +++ b/crates/angular_conformance/fixtures/schema_trusted_types_sinks_spec.json @@ -1,6 +1,6 @@ { "name": "trusted_types_sinks_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/schema/trusted_types_sinks_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/schema/trusted_types_sinks_spec.ts", "test_groups": [ { "name": "isTrustedTypesSink", @@ -24,4 +24,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/selector_selector_spec.json b/crates/angular_conformance/fixtures/selector_selector_spec.json index 2f9fb9207..0f6ecaec6 100644 --- a/crates/angular_conformance/fixtures/selector_selector_spec.json +++ b/crates/angular_conformance/fixtures/selector_selector_spec.json @@ -1,6 +1,6 @@ { "name": "selector_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/selector/selector_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/selector/selector_spec.ts", "test_groups": [ { "name": "SelectorMatcher", @@ -185,4 +185,4 @@ ] } ] -} +} \ No newline at end of file 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 911889638..82a95d180 100644 --- a/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_at_rules_spec.json @@ -1,6 +1,6 @@ { "name": "at_rules_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/at_rules_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/at_rules_spec.ts", "test_groups": [ { "name": "ShadowCss, at-rules", @@ -223,4 +223,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_host_and_host_context_spec.json b/crates/angular_conformance/fixtures/shadow_css_host_and_host_context_spec.json index e7973930b..f4311b446 100644 --- a/crates/angular_conformance/fixtures/shadow_css_host_and_host_context_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_host_and_host_context_spec.json @@ -1,6 +1,6 @@ { "name": "host_and_host_context_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/host_and_host_context_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/host_and_host_context_spec.ts", "test_groups": [ { "name": "ShadowCss, :host and :host-context", @@ -661,4 +661,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json b/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json index c40b48732..137acf60e 100644 --- a/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_keyframes_spec.json @@ -1,6 +1,6 @@ { "name": "keyframes_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/keyframes_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/keyframes_spec.ts", "test_groups": [ { "name": "ShadowCss, keyframes and animations", @@ -139,4 +139,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_ng_deep_spec.json b/crates/angular_conformance/fixtures/shadow_css_ng_deep_spec.json index 221ebc19e..85528f2ee 100644 --- a/crates/angular_conformance/fixtures/shadow_css_ng_deep_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_ng_deep_spec.json @@ -1,6 +1,6 @@ { "name": "ng_deep_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/ng_deep_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/ng_deep_spec.ts", "test_groups": [ { "name": "ShadowCss, ng-deep", @@ -24,4 +24,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_polyfills_spec.json b/crates/angular_conformance/fixtures/shadow_css_polyfills_spec.json index 80e62fa73..1018a4881 100644 --- a/crates/angular_conformance/fixtures/shadow_css_polyfills_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_polyfills_spec.json @@ -1,6 +1,6 @@ { "name": "polyfills_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/polyfills_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/polyfills_spec.ts", "test_groups": [ { "name": "ShadowCss, polyfills", @@ -29,4 +29,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_process_rules_spec.json b/crates/angular_conformance/fixtures/shadow_css_process_rules_spec.json index 967b81995..57623544b 100644 --- a/crates/angular_conformance/fixtures/shadow_css_process_rules_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_process_rules_spec.json @@ -1,6 +1,6 @@ { "name": "process_rules_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/process_rules_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/process_rules_spec.ts", "test_groups": [ { "name": "ShadowCss, processRules", @@ -56,4 +56,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/shadow_css_repeat_groups_spec.json b/crates/angular_conformance/fixtures/shadow_css_repeat_groups_spec.json index c58581ea9..de6f7b813 100644 --- a/crates/angular_conformance/fixtures/shadow_css_repeat_groups_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_repeat_groups_spec.json @@ -1,6 +1,6 @@ { "name": "repeat_groups_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/repeat_groups_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/repeat_groups_spec.ts", "test_groups": [ { "name": "ShadowCss, repeatGroups()", @@ -24,4 +24,4 @@ ] } ] -} +} \ No newline at end of file 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 dede81855..8158e847d 100644 --- a/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json +++ b/crates/angular_conformance/fixtures/shadow_css_shadow_css_spec.json @@ -1,6 +1,6 @@ { "name": "shadow_css_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/shadow_css_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/shadow_css/shadow_css_spec.ts", "test_groups": [ { "name": "ShadowCss", @@ -10,43 +10,43 @@ "groups": [], "tests": [ { - "name": "should replace multiline comments with newline", - "path": "ShadowCss/comments/should replace multiline comments with newline", + "name": "should remove inline comments without adding extra lines", + "path": "ShadowCss/comments/should remove inline comments without adding extra lines", "assertions": [ { "type": "ShimCss", "input": "/* b {c} */ b {c}", "content_attr": "contenta", "host_attr": null, - "expected": "\n b[contenta] {c}", + "expected": " b[contenta] {c}", "normalized": false } ] }, { - "name": "should replace multiline comments with newline in the original position", - "path": "ShadowCss/comments/should replace multiline comments with newline in the original position", + "name": "should preserve internal newlines from multiline comments", + "path": "ShadowCss/comments/should preserve internal newlines from multiline comments", "assertions": [ { "type": "ShimCss", "input": "/* b {c}\n */ b {c}", "content_attr": "contenta", "host_attr": null, - "expected": "\n\n b[contenta] {c}", + "expected": "\n b[contenta] {c}", "normalized": false } ] }, { - "name": "should replace comments with newline in the original position", - "path": "ShadowCss/comments/should replace comments with newline in the original position", + "name": "should remove multiple inline comments without adding extra lines", + "path": "ShadowCss/comments/should remove multiple inline comments without adding extra lines", "assertions": [ { "type": "ShimCss", "input": "/* b {c} */ b {c} /* a {c} */ a {c}", "content_attr": "contenta", "host_attr": null, - "expected": "\n b[contenta] {c} \n a[contenta] {c}", + "expected": " b[contenta] {c} a[contenta] {c}", "normalized": false } ] @@ -82,7 +82,7 @@ "input": "/* comment 1 */ /* comment 2 */ b {c}", "content_attr": "contenta", "host_attr": null, - "expected": "\n \n b[contenta] {c}", + "expected": " b[contenta] {c}", "normalized": false } ] @@ -981,4 +981,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/style_url_resolver_spec.json b/crates/angular_conformance/fixtures/style_url_resolver_spec.json index cdd85ee34..f138797e6 100644 --- a/crates/angular_conformance/fixtures/style_url_resolver_spec.json +++ b/crates/angular_conformance/fixtures/style_url_resolver_spec.json @@ -1,6 +1,6 @@ { "name": "style_url_resolver_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/style_url_resolver_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/style_url_resolver_spec.ts", "test_groups": [ { "name": "isStyleUrlResolvable", @@ -34,4 +34,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/fixtures/util_spec.json b/crates/angular_conformance/fixtures/util_spec.json index 564faad32..df5ba0542 100644 --- a/crates/angular_conformance/fixtures/util_spec.json +++ b/crates/angular_conformance/fixtures/util_spec.json @@ -1,6 +1,6 @@ { "name": "util_spec.ts", - "file_path": "/Users/brooklyn/workspace/github/oxc/crates/oxc_angular_compiler/angular/packages/compiler/test/util_spec.ts", + "file_path": "/Users/brooklyn/workspace/github/oxc-angular-compiler/crates/oxc_angular_compiler/angular/packages/compiler/test/util_spec.ts", "test_groups": [ { "name": "util", @@ -68,4 +68,4 @@ "tests": [] } ] -} +} \ No newline at end of file diff --git a/crates/angular_conformance/snapshots/angular.snap.md b/crates/angular_conformance/snapshots/angular.snap.md index 5147021cc..393861e66 100644 --- a/crates/angular_conformance/snapshots/angular.snap.md +++ b/crates/angular_conformance/snapshots/angular.snap.md @@ -7,13 +7,13 @@ | 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 | 267 | 0 | 0 | 0 | 267 | 100.0% | +| expression_parser | 266 | 0 | 0 | 0 | 266 | 100.0% | | expression_serializer | 38 | 0 | 0 | 0 | 38 | 100.0% | -| html_lexer | 284 | 0 | 0 | 0 | 284 | 100.0% | -| html_parser | 85 | 0 | 0 | 0 | 85 | 100.0% | +| html_lexer | 288 | 0 | 0 | 0 | 288 | 100.0% | +| html_parser | 87 | 0 | 0 | 0 | 87 | 100.0% | | html_whitespace | 21 | 0 | 0 | 0 | 21 | 100.0% | -| r3_transform | 172 | 0 | 0 | 0 | 172 | 100.0% | +| r3_transform | 174 | 0 | 0 | 0 | 174 | 100.0% | | shadow_css | 172 | 0 | 0 | 0 | 172 | 100.0% | | style_parser | 15 | 0 | 0 | 0 | 15 | 100.0% | -| **Total** | **1252** | **0** | **0** | **0** | **1252** | **100.0%** | +| **Total** | **1259** | **0** | **0** | **0** | **1259** | **100.0%** | diff --git a/crates/angular_conformance/src/subsystems/r3_transform/humanizer.rs b/crates/angular_conformance/src/subsystems/r3_transform/humanizer.rs index 37ff77b02..78e84406b 100644 --- a/crates/angular_conformance/src/subsystems/r3_transform/humanizer.rs +++ b/crates/angular_conformance/src/subsystems/r3_transform/humanizer.rs @@ -675,6 +675,25 @@ impl<'a> R3Visitor<'a> for R3Humanizer<'_> { for group in &block.groups { self.visit_switch_block_case_group(group); } + // Angular v21.2.7 exhaustive-switch feature: emit the `@default never;` + // marker after the case groups (matching upstream `block.exhaustiveCheck?.visit`). + if let Some(exhaustive_check) = &block.exhaustive_check { + self.visit_switch_exhaustive_check(exhaustive_check); + } + } + + fn visit_switch_exhaustive_check( + &mut self, + check: &oxc_angular_compiler::ast::r3::R3SwitchExhaustiveCheck, + ) { + let row = if self.mode == HumanizeMode::SourceSpans { + let source_span = self.span_text(&check.source_span); + let start_span = self.span_text(&check.start_source_span); + vec!["SwitchExhaustiveCheck".to_string(), source_span, start_span] + } else { + vec!["SwitchExhaustiveCheck".to_string()] + }; + self.result.push(row); } fn visit_switch_block_case_group( diff --git a/crates/oxc_angular_compiler/angular b/crates/oxc_angular_compiler/angular index b2b903957..50761c8be 160000 --- a/crates/oxc_angular_compiler/angular +++ b/crates/oxc_angular_compiler/angular @@ -1 +1 @@ -Subproject commit b2b903957a5bafc343f8970e0562d3d812a121af +Subproject commit 50761c8be4939c5a8f14b986cea93a9b68152c49 diff --git a/crates/oxc_angular_compiler/src/ast/html.rs b/crates/oxc_angular_compiler/src/ast/html.rs index 0f0ac7881..8128d7988 100644 --- a/crates/oxc_angular_compiler/src/ast/html.rs +++ b/crates/oxc_angular_compiler/src/ast/html.rs @@ -125,6 +125,18 @@ pub struct HtmlElement<'a> { /// Whether this is a void element (area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr). /// Void elements cannot have content and do not have end tags. pub is_void: bool, + /// True only when the parser tokenized this as a selectorless COMPONENT + /// (which requires selectorless mode to be enabled). This distinguishes a + /// bare component `` from an uppercase NORMAL element `"#), + ("src".to_string(), "ResourceUrl".to_string()) + ); + } + + // ---- i18n trusted-types sink ---- + + #[test] + fn comp_iframe_i18n_src_is_disallowed() { + let errors = transform_errors(r#"hi"#); + assert!( + has_disallowed_error(&errors, "src"), + "expected i18n disallowed error for iframe|src, got: {errors:?}" + ); + } + + #[test] + fn control_bare_comp_i18n_src_is_allowed() { + // tagName null -> isTrustedType false -> NO error (matches upstream). + let errors = transform_errors(r#"hi"#); + assert!( + !errors.iter().any(|e| e.contains("disallowed for security reasons")), + "expected NO i18n disallowed error for bare , got: {errors:?}" + ); + } + + #[test] + fn control_bare_comp_class_named_object_i18n_data_is_allowed() { + // REGRESSION GUARD: class `Object`, NO tag part -> tagName null -> NO error + // (pre-fix the class name leaked into `object|data` and spuriously errored). + let errors = transform_errors(r#"hi"#); + assert!( + !errors.iter().any(|e| e.contains("disallowed for security reasons")), + "expected NO i18n disallowed error for bare , got: {errors:?}" + ); + } + + #[test] + fn control_normal_iframe_i18n_src_is_disallowed() { + let errors = transform_errors(r#""#); + assert!( + has_disallowed_error(&errors, "src"), + "expected i18n disallowed error for normal iframe|src, got: {errors:?}" + ); + } + + // ---- i18n trusted-types sink: namespace must NOT be stripped, bare component skips ---- + // + // These assert faithfulness to v21.2.7 `render3/view/i18n/meta.ts` (~210-214): + // isTrustedType = node instanceof html.Component + // ? (node.tagName === null ? false : isTrustedTypesSink(node.tagName, name)) + // : isTrustedTypesSink(node.name, name); + // For a NORMAL element it passes the FULL `node.name` (un-stripped, e.g. + // `:svg:iframe`); for a COMPONENT it passes the resolved `node.tagName` + // (un-stripped, e.g. `:svg:iframe`); for a BARE component (tagName null) it + // SHORT-CIRCUITS to false. `isTrustedTypesSink` only lowercases (NO ns-strip), + // so `:svg:iframe|src` is NOT a member of TRUSTED_TYPES_SINKS -> ALLOWED. + // All expected outcomes were verified by executing + // `parseTemplate(tpl, 'test.html', {enableSelectorless:true})` against + // @angular/compiler@21.2.7. + + #[test] + fn normal_svg_iframe_i18n_src_is_allowed() { + // Normal namespaced element, full name `:svg:iframe`; upstream passes + // `node.name` un-stripped -> `:svg:iframe|src` is NOT a sink -> ALLOWED. + // (Pre-fix OXC ns-stripped to `iframe|src` and wrongly BLOCKED.) + let errors = transform_errors(r#""#); + assert!( + !errors.iter().any(|e| e.contains("disallowed for security reasons")), + "expected NO i18n disallowed error for , got: {errors:?}" + ); + } + + #[test] + fn comp_svg_iframe_i18n_src_is_allowed() { + // Selectorless component resolved to `:svg:iframe` (inside ); upstream + // passes `node.tagName` un-stripped -> `:svg:iframe|src` NOT a sink -> ALLOWED. + // (Pre-fix OXC ns-stripped to `iframe|src` and wrongly BLOCKED.) + let errors = + transform_errors(r#"hi"#); + assert!( + !errors.iter().any(|e| e.contains("disallowed for security reasons")), + "expected NO i18n disallowed error for , got: {errors:?}" + ); + } + + #[test] + fn bare_comp_i18n_inner_html_is_allowed() { + // Bare component (tagName null) -> upstream short-circuits isTrustedType to + // false -> ALLOWED, even though `*|innerhtml` IS a wildcard sink. (Pre-fix + // OXC passed an EMPTY STRING which matched `*|innerhtml` and wrongly BLOCKED.) + let errors = transform_errors(r#"hi"#); + assert!( + !errors.iter().any(|e| e.contains("disallowed for security reasons")), + "expected NO i18n disallowed error for bare , got: {errors:?}" + ); + } +} + +// ============================================================================ +// DEFAULT (non-selectorless) parse mode: an UPPERCASE-leading HTML tag like +// `
    ", "TestCmp"); + assert!( + !js.contains("ɵɵvalidateAttribute"), + "unexpected ɵɵvalidateAttribute for
    , got:\n{js}" + ); + assert!(js.contains("ɵɵattribute"), "expected ɵɵattribute for
    , got:\n{js}"); +}