()
| 5 | const assert = require('assert'); |
| 6 | |
| 7 | function testFastSwap16() { |
| 8 | const buf = Buffer.from([0x01, 0x02, 0x03, 0x04]); |
| 9 | const expected = Buffer.from([0x02, 0x01, 0x04, 0x03]); |
| 10 | const padded = Buffer.alloc(256); |
| 11 | buf.copy(padded); |
| 12 | padded.swap16(); |
| 13 | assert.deepStrictEqual(padded.subarray(0, 4), expected); |
| 14 | } |
| 15 | |
| 16 | function testFastSwap32() { |
| 17 | const buf = Buffer.from([0x01, 0x02, 0x03, 0x04]); |
no test coverage detected