add detailed comments Fix #58941
Add detailed Comments in the function

Thanks for the PR, but IMO I think this testing function is clear as is and the refactor isn't necessarily better than the original.

Closing but happy to have your contributions towards issues labeled `good first issue`