Skip to content
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

Branch: 17277-StringasInteger-has-not-defined-behavior, Fixes #17277 #17918

Open
wants to merge 2 commits into
base: Pharo13
Choose a base branch
from

Conversation

pavel-krivanek
Copy link
Collaborator

String>>#asInteger uses NumberParser

Later, we should deprecate asSignedInteger

…roject#17277

String>>#asInteger uses NumberParser
@Ducasse
Copy link
Member

Ducasse commented Mar 2, 2025

Yes this is better.

@Ducasse
Copy link
Member

Ducasse commented Mar 2, 2025

Oops
we have some tests based on this bad behavior.

For example

Got 1.234 instead of 1.
Stacktrace

TestFailure
Got 1.234 instead of 1.
CommentTestCase(TestAsserter)>>assert:description:resumable:
CommentTestCase(TestAsserter)>>assert:description:
CommentTestCase(TestAsserter)>>assert:equals:
CommentTestCase>>testIt
CommentTestCase(TestCase)>>performTest

@Ducasse
Copy link
Member

Ducasse commented Mar 2, 2025

[osx-64 / Tests-osx-64 / MacOSX64.PharoDocComment.Tests.CommentTestCase.nil](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-17918/1/testReport/junit/MacOSX64.PharoDocComment.Tests/CommentTestCase/osx_64___Tests_osx_64___nil/)
[osx-64 / Tests-osx-64 / MacOSX64.Reflectivity.Tests.ReflectivityOnStackTest.testExecuteWithWaitingWithLinkInstalledAfterExecutionOfMethodInInlinedBlockChangeMethodManually](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-17918/1/testReport/junit/MacOSX64.Reflectivity.Tests/ReflectivityOnStackTest/osx_64___Tests_osx_64___testExecuteWithWaitingWithLinkInstalledAfterExecutionOfMethodInInlinedBlockChangeMethodManually/)
[osx-64 / Tests-osx-64 / MacOSX64.SUnit.Tests.ProcessMonitorTestServiceTest.testFailTestWhenBackgroundProcessWasFailedDuringFinalTryToFinishItAtTestCompletionTime](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-17918/1/testReport/junit/MacOSX64.SUnit.Tests/ProcessMonitorTestServiceTest/osx_64___Tests_osx_64___testFailTestWhenBackgroundProcessWasFailedDuringFinalTryToFinishItAtTestCompletionTime/)
[osx-64 / Tests-osx-64 / MacOSX64.System.Time.Tests.DurationTest.testReadFromNoException](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-17918/1/testReport/junit/MacOSX64.System.Time.Tests/DurationTest/osx_64___Tests_osx_64___testReadFromNoException/)

@pavel-krivanek
Copy link
Collaborator Author

I changed it to ^ (NumberParser parse: self onError: [ ^ nil ]) asInteger

@pavel-krivanek
Copy link
Collaborator Author

in the case of the Duration Tests, the problem is that NumberParser does not accept plus sign at the beginning:
'+0' asInteger.

The question is, what to do then.

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

Successfully merging this pull request may close these issues.

None yet

3 participants