Conversation
Pull Request Test Coverage Report for Build 20029366737Details
💛 - Coveralls |
Allow users to provide a custom error message as the second argument: assert($x > 0, "x must be positive"); When the assertion fails, the custom message is displayed instead of the auto-generated one. This is useful when the default message (e.g., "Assertion failed (0 > 0)") is not descriptive enough. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
kfly8
added a commit
that referenced
this pull request
Dec 8, 2025
Changelog diff is: diff --git a/Changes b/Changes index 960d9de..b9e7aba 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,10 @@ Revision history for Perl extension Syntax-Keyword-Assert {{$NEXT}} +0.17 2025-12-08T13:44:46Z + - Add custom error message support #11 + - Fix test failures on Windows and older Perl #13 + 0.16 2024-12-18T09:01:18Z - Fixed `isa` operator #9
kfly8
added a commit
that referenced
this pull request
Dec 9, 2025
Changelog diff is: diff --git a/Changes b/Changes index b9e7aba..6d909ea 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,9 @@ Revision history for Perl extension Syntax-Keyword-Assert {{$NEXT}} +0.18 2025-12-09T05:21:47Z + - Implement lazy evaluation for custom message expression #14 + 0.17 2025-12-08T13:44:46Z - Add custom error message support #11 - Fix test failures on Windows and older Perl #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When an assertion fails, the default error message (e.g.,
Assertion failed (0 == 1)) may not clearly explain what went wrong.Solution
Allow users to provide a custom error message as the second argument:
This makes it easier to understand the context of the failure without inspecting the code.