()
| 14 | } |
| 15 | |
| 16 | function testFastSwap32() { |
| 17 | const buf = Buffer.from([0x01, 0x02, 0x03, 0x04]); |
| 18 | const expected = Buffer.from([0x04, 0x03, 0x02, 0x01]); |
| 19 | const padded = Buffer.alloc(256); |
| 20 | buf.copy(padded); |
| 21 | padded.swap32(); |
| 22 | assert.deepStrictEqual(padded.subarray(0, 4), expected); |
| 23 | } |
| 24 | |
| 25 | function testFastSwap64() { |
| 26 | const buf = Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]); |
no test coverage detected