File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 22require ( '../common' ) ;
33const assert = require ( 'assert' ) ;
44
5- const buf = Buffer . allocUnsafe ( 8 ) ;
5+ const buf = Buffer . allocUnsafe ( 9 ) ;
66
77[ 'LE' , 'BE' ] . forEach ( function ( endianness ) {
88 // Should allow simple BigInts to be written and read
@@ -27,6 +27,11 @@ const buf = Buffer.allocUnsafe(8);
2727 buf [ `writeBigUInt64${ endianness } ` ] ( val , 0 ) ;
2828 assert . strictEqual ( val , buf [ `readBigUInt64${ endianness } ` ] ( 0 ) ) ;
2929
30+ assert . strictEqual ( buf [ `writeBigUInt64${ endianness } ` ] ( val , 0 ) , 8 ) ;
31+ assert . strictEqual ( buf [ `writeBigInt64${ endianness } ` ] ( val , 0 ) , 8 ) ;
32+ assert . strictEqual ( buf [ `writeBigUInt64${ endianness } ` ] ( val , 1 ) , 9 ) ;
33+ assert . strictEqual ( buf [ `writeBigInt64${ endianness } ` ] ( val , 1 ) , 9 ) ;
34+
3035 // Should throw a RangeError upon INT64_MAX+1 being written
3136 assert . throws ( function ( ) {
3237 const val = 0x8000000000000000n ;
You can’t perform that action at this time.
0 commit comments