The TypeScript, Python and Dart conformance harnesses run the parse_expression_template cases in conformance/core/expressions.yaml. The Swift harness in swift/core/Tests/A2UIConformanceTests/ runs validator_v0_9.yaml, data_model.yaml and accessibility.yaml, but not expressions.yaml.
The Swift expression parser is tested only by swift/core/Tests/BasicCatalogTests/ExpressionParserTests.swift. Every new case in conformance/core/expressions.yaml (such as those added in #2807) requires a duplicate Swift unit test.
Proposed change:
- Add a
parse_expression_template action handler to the Swift conformance harness and run conformance/core/expressions.yaml.
- Map
FunctionError.executionFailed to the ParseError category, and match expect_error.message as a regular expression, matching the TypeScript and Dart harnesses.
- Compare numeric results by value so an integer in the YAML such as
100000 matches both .integer(100000) and .number(100000) where appropriate.
- Remove the tests in
ExpressionParserTests.swift that only duplicate conformance cases.
The TypeScript, Python and Dart conformance harnesses run the
parse_expression_templatecases inconformance/core/expressions.yaml. The Swift harness inswift/core/Tests/A2UIConformanceTests/runsvalidator_v0_9.yaml,data_model.yamlandaccessibility.yaml, but notexpressions.yaml.The Swift expression parser is tested only by
swift/core/Tests/BasicCatalogTests/ExpressionParserTests.swift. Every new case inconformance/core/expressions.yaml(such as those added in #2807) requires a duplicate Swift unit test.Proposed change:
parse_expression_templateaction handler to the Swift conformance harness and runconformance/core/expressions.yaml.FunctionError.executionFailedto theParseErrorcategory, and matchexpect_error.messageas a regular expression, matching the TypeScript and Dart harnesses.100000matches both.integer(100000)and.number(100000)where appropriate.ExpressionParserTests.swiftthat only duplicate conformance cases.