kenhuuu commented on code in PR #3340:
URL: https://github.com/apache/tinkerpop/pull/3340#discussion_r2985633454


##########
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:
   Nit: The GremlinLang parser needs to test if a number fits into a certain 
range when it doesn't come with a suffix. If JavaScript can't differentiate 
between byte, short and integer, then it would be fastest if you appended an 
`i` to signify to the server that it is an integer.



-- 
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]

Reply via email to