Skip to content

Rewrite test result message #92

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

Merged
merged 1 commit into from
May 21, 2025
Merged

Rewrite test result message #92

merged 1 commit into from
May 21, 2025

Conversation

IsaacG
Copy link
Member

@IsaacG IsaacG commented May 18, 2025

No description provided.

@IsaacG
Copy link
Member Author

IsaacG commented May 18, 2025

SET message = 'Result for ' || tests.task || ' ' || tests.item || ' ' || tests.score || ' is ' || actual.result || ', but should be ' || tests.expected
SET message = (
'Result for ' || tests.task || ' ' || tests.item || ' ' || tests.score
|| ' is <' || CASE WHEN actual.result IS NULL THEN "NULL" ELSE actual.result END
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
|| ' is <' || CASE WHEN actual.result IS NULL THEN "NULL" ELSE actual.result END
|| ' is <' || COALESCE(actual.result, "NULL")

Copy link
Member

Choose a reason for hiding this comment

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

This is the canonical way IIRC.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for showing us the way! PR updated.

Copy link
Member

@SleeplessByte SleeplessByte left a comment

Choose a reason for hiding this comment

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

Only skimmed it. Didn't check if these were actually tested / if it works as expected, but the overall structure seems fine.

@IsaacG IsaacG merged commit 6523d8e into exercism:main May 21, 2025
2 checks passed
@IsaacG IsaacG deleted the test_msg branch May 21, 2025 22:50
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.

3 participants