kenhuuu commented on code in PR #3340:
URL: https://github.com/apache/tinkerpop/pull/3340#discussion_r2985635956
##########
gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/gremlin-lang-test.js:
##########
@@ -309,10 +309,40 @@ describe('GremlinLang', function () {
assert.strictEqual(g.V(new
Long('9007199254740993')).getGremlinLang().getGremlin(),
'g.V(9007199254740993L)');
});
+ it('should handle bigint as BigInteger (N suffix)', function () {
+ assert.strictEqual(g.inject(BigInt(5)).getGremlinLang().getGremlin(),
'g.inject(5N)');
+
assert.strictEqual(g.inject(BigInt('9223372036854775807')).getGremlinLang().getGremlin(),
'g.inject(9223372036854775807N)');
+
assert.strictEqual(g.inject(BigInt(10)**BigInt(30)).getGremlinLang().getGremlin(),
'g.inject(1000000000000000000000000000000N)');
+ });
+
+ it('should handle number integer in Int32 range', function () {
+ assert.strictEqual(g.inject(42).getGremlinLang().getGremlin(),
'g.inject(42)');
Review Comment:
To clarify, this doesn't need to be done if considered risky and the
performance gain is minimal. Just something to think about.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]