@@ -7,49 +7,49 @@ const buf = Buffer.allocUnsafe(8);
77[ 'LE' , 'BE' ] . forEach ( function ( endianness ) {
88 // Should allow simple BigInts to be written and read
99 let val = 123456789n ;
10- buf [ ' writeBigInt64' + endianness ] ( val , 0 ) ;
11- let rtn = buf [ ' readBigInt64' + endianness ] ( 0 ) ;
10+ buf [ ` writeBigInt64${ endianness } ` ] ( val , 0 ) ;
11+ let rtn = buf [ ` readBigInt64${ endianness } ` ] ( 0 ) ;
1212 assert . strictEqual ( val , rtn ) ;
1313
1414 // Should allow INT64_MAX to be written and read
1515 val = 0x7fffffffffffffffn ;
16- buf [ ' writeBigInt64' + endianness ] ( val , 0 ) ;
17- rtn = buf [ ' readBigInt64' + endianness ] ( 0 ) ;
16+ buf [ ` writeBigInt64${ endianness } ` ] ( val , 0 ) ;
17+ rtn = buf [ ` readBigInt64${ endianness } ` ] ( 0 ) ;
1818 assert . strictEqual ( val , rtn ) ;
1919
2020 // Should read and write a negative signed 64-bit integer
2121 val = - 123456789n ;
22- buf [ ' writeBigInt64' + endianness ] ( val , 0 ) ;
23- assert . strictEqual ( val , buf [ ' readBigInt64' + endianness ] ( 0 ) ) ;
22+ buf [ ` writeBigInt64${ endianness } ` ] ( val , 0 ) ;
23+ assert . strictEqual ( val , buf [ ` readBigInt64${ endianness } ` ] ( 0 ) ) ;
2424
2525 // Should read and write an unsigned 64-bit integer
2626 val = 123456789n ;
27- buf [ ' writeBigUInt64' + endianness ] ( val , 0 ) ;
28- assert . strictEqual ( val , buf [ ' readBigUInt64' + endianness ] ( 0 ) ) ;
27+ buf [ ` writeBigUInt64${ endianness } ` ] ( val , 0 ) ;
28+ assert . strictEqual ( val , buf [ ` readBigUInt64${ endianness } ` ] ( 0 ) ) ;
2929
3030 // Should throw a RangeError upon INT64_MAX+1 being written
3131 assert . throws ( function ( ) {
3232 const val = 0x8000000000000000n ;
33- buf [ ' writeBigInt64' + endianness ] ( val , 0 ) ;
33+ buf [ ` writeBigInt64${ endianness } ` ] ( val , 0 ) ;
3434 } , RangeError ) ;
3535
3636 // Should throw a RangeError upon UINT64_MAX+1 being written
3737 assert . throws ( function ( ) {
3838 const val = 0x10000000000000000n ;
39- buf [ ' writeBigUInt64' + endianness ] ( val , 0 ) ;
39+ buf [ ` writeBigUInt64${ endianness } ` ] ( val , 0 ) ;
4040 } , {
4141 code : 'ERR_OUT_OF_RANGE' ,
4242 message : 'The value of "value" is out of range. It must be ' +
43- '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n'
43+ '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n'
4444 } ) ;
4545
4646 // Should throw a TypeError upon invalid input
4747 assert . throws ( function ( ) {
48- buf [ ' writeBigInt64' + endianness ] ( 'bad' , 0 ) ;
48+ buf [ ` writeBigInt64${ endianness } ` ] ( 'bad' , 0 ) ;
4949 } , TypeError ) ;
5050
5151 // Should throw a TypeError upon invalid input
5252 assert . throws ( function ( ) {
53- buf [ ' writeBigUInt64' + endianness ] ( 'bad' , 0 ) ;
53+ buf [ ` writeBigUInt64${ endianness } ` ] ( 'bad' , 0 ) ;
5454 } , TypeError ) ;
5555} ) ;
0 commit comments