Skip to content

Add Tests for Lexer/Parser Errors & Messages #4

Description

@WillBAnders

Description

There are currently no tests for errors raised by lexer/parser, which is primary because we cannot determine the exact reason it errors. I see two main ways to test this:

  • Test that the range returned matches the expected error range. This does not account for errors covering the same range but have different messages.
  • Test that the summary and details message match expected values, fixing the above limitation.

For testing messages, I would prefer to have a way to access the message dynamically through something like a ResourceBundle rather than hardcoding them in text. This also moves us in the direction of translatable messages, which is a benefit as well. I'm not quite sure how to go about this at the moment, hence this issue.

Motivation

These error messages in particular are extremely important since they're displayed to users, and we should ensure their accurate for the error and generally suggest the correct solution. This also helps us do the same for serializers later on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions