-
Notifications
You must be signed in to change notification settings - Fork 47
Conversation
Removed incorrect character class operator. Improved testing to check for string use case. Added testing for not equals number operator.
Should have run a full test sweep, looking over the failures now to see what gives. |
Looks like you made a lot of style changes. I believe the projects perltidy rc is in the project root. Some lines were entirly style changes. I am not super strict about only accepting patches of the main style, but I would prefer not to merge style only line changes that move away from the main style. |
To be clear, looks_like_number is clearly the correct way to go here, so I do want this patch once the kinks are worked out :-) |
There is no perltidy rc :( I checked, I thought that may have been a issue i just did a vanilla pass on it |
Ok. I will have to fix that. The git repo for Test2 itself (test-simple dist) should have it. |
This PR makes some incorrect assumptions.
The point of This is important for things like object overloading, strings like number() is used to force the use of numerical comparisons. It is in no way supposed to enforce that the thing is actually a number. That said the name is ambiguous and I can see why the confusion arose. This needs better documentation, and perhaps an is_number() shortcut for the DSL that simply ensures that the value seen is a number. I am closing this PR as switching these regex's to use looks_like_number leads to code that does not solve the intended problem. |
Please don't take my above message as criticisms, and please do continue to submit issues to me. I was also confused as to what my code was doing on a second look, which means it has problems and needs more docs/comments. I would love it if you wanted to submit a PR for those, or for an is_number() check in the DSL. |
also note, I just pushed the perltidyrc to the repo. |
Added Scalar::Util looks_like_number to determine numbers.
Removed incorrect Regex character class operator.
Improved testing to check for string use case.
Added testing for not equals number operator.