Implement CQL Long#361
Closed
cmoesel wants to merge 2 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## test-server #361 +/- ##
===============================================
+ Coverage 87.58% 87.82% +0.24%
===============================================
Files 52 53 +1
Lines 4607 4675 +68
Branches 1297 1299 +2
===============================================
+ Hits 4035 4106 +71
- Misses 359 373 +14
+ Partials 213 196 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add support for Long literal, ToLong conversion, min/max long values - Use JavaScript Number to represent Long (NOTE: this means that values are imprecise outside of the safe integer range in JS) - Add tests for literals, conversion, and other operations that accept Long arguments - Improve underflow/overflow tests to test boundaries more carefully - Added .skip to tests that fail due to Number imprecision for high values - Unskipped Long tests in the spec tests that now pass
Update support for Long to use BigInt so we can distinguish between decimal/integer (JS Number) and long (JS BigInt).
Member
Author
|
Closing this PR in favor of #363, which is based on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for CQL Long, represented using
BigIntin JavaScript. Since Integer and Decimal are represented using Number, we can easily distinguish CQL Longs from Integers and Decimals by their type (typeof var === 'bigint'). This actually made implementation easier (and more correct) compared to my initial implementation using Number (which I thought would be easier since it was more of an incremental change, but maybe not).I based this PR on the
test-serverbranch so I could test it with the CQL Test Runner, but in hindsight, that also wasn't that smart because of cql-tests-runner#79 (which basically reports that the test runner doesn't correctly detect equal Longs). Oh well. If you want to test it using the Test Runner anyway, feel free -- but I've updated the cql-tests-runner mitre-wip branch to skip the Long tests since the runner doesn't support them correctly.This PR is configured to go into the
test-serverbranch, but that's just so it is easy to see only the relevant changes in the diff. I'm marking this draft for now because I thinktest-servershould be merged first (if we decide to merge it) and then this should be changed to be based onmain.Submitter:
npm run test:plusto run tests, lint, and prettier)cql4browsers.jsbuilt withnpm run build:browserifyif source changed.Reviewer:
Name: