Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make failure messages more readable #717

Merged
merged 6 commits into from
Sep 20, 2023
Merged

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Sep 19, 2023

Description

  • Uniform the failure messages and add missing failure types.
  • Copy the existing string representation logic of the string() function into the value types.

Related issues

closes #713

@saig0
Copy link
Member Author

saig0 commented Sep 19, 2023

@nicpuppa I improved the failure messages as a follow-up from our last PR. Please have a look. 🍪

Copy the existing string representation logic of the `string()` function into the value types.
Replace the custom string representation logic of the `string()` function with the `toString()` method of the types.
Uniform the failure messages. Add missing failure types.
The functions `andThen()` and `compose()` are auto-generated by Scala. We can ignore changes on these functions.
Copy link
Contributor

@nicpuppa nicpuppa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very big improvement 💪

)
}

it should "report a suppressed failure if an addition has incompatible values" in {
evaluateExpression("2 + true") should reportFailure(
failureType = EvaluationFailureType.INVALID_TYPE,
failureMessage = "Expected Number but found 'ValBoolean(true)'"
failureMessage = "Expected number but found 'true'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ How this is possible ? 🪄

Number -> number

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I aligned the failure messages and changed the type names to start with a lowercase. See here. 🚀

@saig0 saig0 added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit fc7b2cf Sep 20, 2023
3 checks passed
@saig0 saig0 deleted the 713-reable-failure-messages branch September 20, 2023 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make failure messages more readable
2 participants