Skip to content

Conversation

@pavel-krivanek
Copy link
Collaborator

String>>#asInteger uses NumberParser

Later, we should deprecate asSignedInteger

@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

@guillep
Copy link
Member

guillep commented Mar 3, 2025

@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.

3 participants