Skip to content

Swift: run conformance/core/expressions.yaml #2839

Description

@gspencergoog

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The team intends to work on this in the near future, or at a lower priority.status: first-line-handled

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions