Skip to content

ext/hash: cleaned up test - #23041

Open
NickSdot wants to merge 2 commits into
php:masterfrom
NickSdot:test/hardening/ext-hash
Open

ext/hash: cleaned up test#23041
NickSdot wants to merge 2 commits into
php:masterfrom
NickSdot:test/hardening/ext-hash

Conversation

@NickSdot

@NickSdot NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Not at all asserted; no point to keep the noise.

@NickSdot
NickSdot marked this pull request as ready for review August 4, 2026 16:27
@NickSdot

NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@LamentXU123 another no owner; one-liner.

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I indeed do not know how these extension works. But since these test fixers are accepted by multiple maintainers I think this is good to merge.

@LamentXU123
LamentXU123 requested a review from iliaal August 4, 2026 17:42
@iliaal

iliaal commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@NickSdot Overall looks ok, but why are we removing $e->getTraceAsString()?

@NickSdot

NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@NickSdot Overall looks ok, but why are we removing $e->getTraceAsString()?

@iliaal bloat for no reason; it is not asserted :)

@iliaal

iliaal commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The idea (i think) was that if the test fails there is more data available in the diff to show why.

@NickSdot

NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The idea (i think) was that if the test fails there is more data available in the diff to show why.

When I look at the text in hash_update() I'd assume it's a debug left-over. 😂 Anyway, if you think it adds value I can add it back. Note: there are 649 other non-asserted that also don't do that; only 3 including this one do it. So if it adds value here we maybe should consider to make it a standard? Your call.

@iliaal

iliaal commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The test expects success via "Done" so any failure path is predictably not exercised, since the goal of the change you are adding is to add more context via class name, I wouldn't remove $e->getTraceAsString() it does no harm (imho) and if the test ever fails there is more info there...

@NickSdot
NickSdot marked this pull request as draft August 4, 2026 18:22
@NickSdot

NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The test expects success via "Done" so any failure path is predictably not exercised, since the goal of the change you are adding is to add more context via class name, I wouldn't remove $e->getTraceAsString() it does no harm (imho) and if the test ever fails there is more info there...

Added it back. All that's left is a tiny style change; sorry I made two people busy for that.

@NickSdot
NickSdot marked this pull request as ready for review August 4, 2026 18:31

@iliaal iliaal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the change ;-)

@NickSdot

NickSdot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@iliaal, may I ask your general opinion to:

there are 649 other non-asserted that also don't do that; only 3 including this one do it. So if it adds value here we maybe should consider to make it a standard?

Worth to do it or nah?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants