-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String as integer #17299
base: Pharo13
Are you sure you want to change the base?
String as integer #17299
Conversation
… and asSignedInteger implementations to return error when the int cannot be parsed.
Full image load fails with:
which looks related |
Yes, the error is related. It is caused by Microdown. There is already a PR that will fix it: pillar-markup/Microdown#901 But, the Microdown PR requires this PR to be merged first. So, We will have the failing tests for a build, then we merge the Microdown PR and all the tests should return to be green. |
Thanks for the suggestion @astares I added the test case |
I have no idea how to fix these tests. Probably somewhere in the baseline the microdown inside Pharo should be unloaded I will propose to remove Microdown from Pharo because it just slows me down all the time.
|
Hello @Ducasse All the tests are now green for Microdown, yes. The problem is that there are 2 tests that will fail when we will integrate this PR, because they depend on the old What I propose is:
|
This PR Does the following:
String>>#asInteger
Now, it returns a integer ONLY if the complete String is a valid integer, else it raises an exception.String>>#asSignedInteger
.String>>#asInteger
toString>>#extractIntegerPart
. That new method behaves exactly as the oldasInteger
.String>>#asUnsignedInteger
to just callString>>#asInteger
and then getting the absolute value.String>>#asInteger
to callString>>#extractIntegerPart
instead.This also closes #17277