Open LucasLaurens opened 4 months ago
Just a thought, I feel like these would be quite nice in a maths (or math) plugin for Pest possibly. I'm not sure how commonly they'd be used.
I can see that there could be quite a lot of mathematical expectations that people would want, but which maybe shouldn't be in core as it'd add additional code.
Don't mind either way though, so going to leave this for someone else.
Just a thought, I feel like these would be quite nice in a maths (or math) plugin for Pest possibly. I'm not sure how commonly they'd be used.
I can see that there could be quite a lot of mathematical expectations that people would want, but which maybe shouldn't be in core as it'd add additional code.
Don't mind either way though, so going to leave this for someone else.
I totally agree with you. I think having an official plugin created by the Pest team to handle all mathematical cases would be really interesting.
If I've done it this way, it's also because I assumed that I was comparing two numbers and that the assertion would return a boolean.
Whether in a plugin or in the main code, I did it because I came across the need on one of my projects and thought it would be interesting to share it with the community.
I really thank you for your feedback, which I find very relevant. In any case, it was a pleasure for me to participate in the evolution of Pest, so I thought I'd propose this feature to help the community in certain cases.
This with the possibility of adding more if this first expectation is accepted and appreciated enough to add more (i mean math expectations).
What:
Description:
This PR adds a
toBePowerOf()
expectation, to validate whether a value is a power of another. If the PR is accepted, I could create one for documentation.Related: