()
| 23 | } |
| 24 | |
| 25 | function testFastSwap64() { |
| 26 | const buf = Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]); |
| 27 | const expected = Buffer.from([0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01]); |
| 28 | const padded = Buffer.alloc(256); |
| 29 | buf.copy(padded); |
| 30 | padded.swap64(); |
| 31 | assert.deepStrictEqual(padded.subarray(0, 8), expected); |
| 32 | } |
| 33 | |
| 34 | eval('%PrepareFunctionForOptimization(Buffer.prototype.swap16)'); |
| 35 | testFastSwap16(); |
no test coverage detected