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

Bug in testLog10() #9

Open
EdmondsZinc opened this issue Sep 3, 2024 · 0 comments
Open

Bug in testLog10() #9

EdmondsZinc opened this issue Sep 3, 2024 · 0 comments

Comments

@EdmondsZinc
Copy link

EdmondsZinc commented Sep 3, 2024

I implemented this expression evaluator back in April of 2024 and deployed it to our production environment.
The tests obviously passed at the time, because it deployed everywhere successfully.

Today, I have been receiving assert failures though for testLog10() in all of our dev sanboxes.

08:34:37.3 (170886575)|FATAL_ERROR|System.AssertException: Assertion Failed:
Expected: 0.0
Actual:   0

Every Sandbox I have tested on is on Winter '25.

Production is still on Sumer '24 and is not receiving assert failures.

Reviewing the code of the evaluator, I noticed that the eval() method does a return res.stripTrailingZeros(); which should obviously strips trailing 0s.

We do have the following SF Issue: https://issues.salesforce.com/issue/a028c00000gAwdUAAS/decimalstriptrailingzeros-doesnt-strip-off-expected-trailing-zeros-for-values-like-00-or-000-etc

This SF Issue indicates inconsistent behavior with values such as 0.0 or 0.00. If you use stripTrailingZeros(), you can get 0.0 and 0.00 still. The issue indicates that it is still in review, but it looks like Winter '25 may have resolved it.

I think the correct solution here is to update the tests that Assert on 0.0 to Assert on 0 now.

Easy enough fix locally, but wanted it pointed out here for the library as well.

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

No branches or pull requests

1 participant