File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2
2
require ( '../common' ) ;
3
3
const assert = require ( 'assert' ) ;
4
4
5
- const buf = Buffer . allocUnsafe ( 8 ) ;
5
+ const buf = Buffer . allocUnsafe ( 9 ) ;
6
6
7
7
[ 'LE' , 'BE' ] . forEach ( function ( endianness ) {
8
8
// Should allow simple BigInts to be written and read
@@ -27,6 +27,11 @@ const buf = Buffer.allocUnsafe(8);
27
27
buf [ `writeBigUInt64${ endianness } ` ] ( val , 0 ) ;
28
28
assert . strictEqual ( val , buf [ `readBigUInt64${ endianness } ` ] ( 0 ) ) ;
29
29
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
+
30
35
// Should throw a RangeError upon INT64_MAX+1 being written
31
36
assert . throws ( function ( ) {
32
37
const val = 0x8000000000000000n ;
You can’t perform that action at this time.
0 commit comments