Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Add some number inequality check functions #258

Closed
leonerd opened this issue Mar 22, 2023 · 1 comment · Fixed by #268
Closed

Add some number inequality check functions #258

leonerd opened this issue Mar 22, 2023 · 1 comment · Fixed by #268

Comments

@leonerd
Copy link
Contributor

leonerd commented Mar 22, 2023

You can easily use is() to check if a number is exactly a given value, or use the Test2::Tools::Compare::float() function to make it approximate. But sometimes you want to test a number using one of the inequality operators. It'd be great if we had something like

$check = number_gt $min; # uses >
$check = number_ge $min; # uses >=
$check = number_le $max; # uses <=
$check = number_lt $max; # uses <

This would be especially useful combined with supporting is()-like testing in is_refcount() (#259).

@exodist
Copy link
Member

exodist commented Apr 28, 2023

comment moved to correct issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants