ballerina-lang
ballerina-lang copied to clipboard
Add validation for decimal values at runtime
Purpose
$title
Fixes #33805
Approach
Determine MIN and MAX values for Ballerina decimal values per IEEE 754 Decimal encoding spec.
Samples
Remarks
Check List
- [x] Read the Contributing Guide
- [ ] Updated Change Log
- [ ] Checked Tooling Support (#<Issue Number>)
- [ ] Added necessary tests
- [x] Unit Tests
- [ ] Spec Conformance Tests
- [ ] Integration Tests
- [ ] Ballerina By Example Tests
- [ ] Increased Test Coverage
- [ ] Added necessary documentation
- [ ] API documentation
- [ ] Module documentation in Module.md files
- [ ] Ballerina By Examples
Codecov Report
Base: 79.24% // Head: 76.64% // Decreases project coverage by -2.60%
:warning:
Coverage data is based on head (
a45c915
) compared to base (3fa663b
). Patch coverage: 93.75% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## master #38057 +/- ##
============================================
- Coverage 79.24% 76.64% -2.61%
+ Complexity 72657 53050 -19607
============================================
Files 3370 3354 -16
Lines 257898 199171 -58727
Branches 45862 25839 -20023
============================================
- Hits 204376 152648 -51728
+ Misses 44504 37851 -6653
+ Partials 9018 8672 -346
Impacted Files | Coverage Δ | |
---|---|---|
...allerina/runtime/internal/values/DecimalValue.java | 61.53% <92.30%> (+1.97%) |
:arrow_up: |
...lerina/runtime/api/constants/RuntimeConstants.java | 94.73% <100.00%> (-1.82%) |
:arrow_down: |
...untime/internal/util/exceptions/RuntimeErrors.java | 99.09% <100.00%> (+1.61%) |
:arrow_up: |
...a/compiler/api/impl/BallerinaKeywordsProvider.java | 0.00% <0.00%> (-66.67%) |
:arrow_down: |
.../compiler/diagnostic/CompilerBadSadDiagnostic.java | 0.00% <0.00%> (-62.50%) |
:arrow_down: |
...tensions/ballerina/document/visitor/FindNodes.java | 0.00% <0.00%> (-61.12%) |
:arrow_down: |
...rinalang/langserver/hover/HoverObjectResolver.java | 27.93% <0.00%> (-60.68%) |
:arrow_down: |
...llerinalang/debugadapter/variable/types/BByte.java | 0.00% <0.00%> (-55.56%) |
:arrow_down: |
...testerina/natives/mock/GenericMockObjectValue.java | 8.75% <0.00%> (-51.25%) |
:arrow_down: |
...alang/compiler/tree/types/BLangFiniteTypeNode.java | 45.83% <0.00%> (-50.01%) |
:arrow_down: |
... and 965 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@gabilang, does this PR cover underflows?
@gabilang, does this PR cover underflows?
No, Created a separate issue to address the subnormal cases. https://github.com/ballerina-platform/ballerina-lang/issues/38082
Shall we add a test https://github.com/ballerina-platform/ballerina-lang/issues/33805#issuecomment-983276303