File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
graal-nodejs/test/graal/unit Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ describe('Other', function () {
6060 util . inspect ( Point ) ;
6161 assert . match ( util . inspect ( point ) , / g e t X / ) ;
6262 } ) ;
63+ it ( 'util.inspect should work for java.math.BigInteger' , function ( ) {
64+ const BigInteger = Java . type ( 'java.math.BigInteger' ) ;
65+ const Long = Java . type ( 'java.lang.Long' ) ;
66+ assert . strictEqual ( String ( 2n ** 64n - 2n ) , util . inspect ( BigInteger . valueOf ( Long . MAX_VALUE ) . shiftLeft ( 1 ) ) ) ;
67+ assert . strictEqual ( String ( 2n ** 63n - 1n ) , util . inspect ( BigInteger . valueOf ( Long . MAX_VALUE ) ) ) ;
68+ assert . strictEqual ( String ( 2n ** 63n - 1n ) , util . inspect ( Long . MAX_VALUE ) ) ;
69+ } ) ;
6370 }
6471 it ( 'should not regress in ExecuteNativeFunctionNode' , function ( ) {
6572 // inspired by a wrong rewrite of ExecuteNativeFunctionNode
You can’t perform that action at this time.
0 commit comments