bufferutils: add Buffer reverse
This commit is contained in:
parent
33955a7fb5
commit
71d4c78b88
4 changed files with 25 additions and 13 deletions
test
|
@ -75,6 +75,19 @@ describe('bufferutils', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('reverse', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('reverses ' + f.hex64 + ' correctly', function() {
|
||||
var buffer = new Buffer(f.hex64, 'hex')
|
||||
var buffer2 = bufferutils.reverse(buffer)
|
||||
|
||||
Array.prototype.reverse.call(buffer)
|
||||
|
||||
assert.deepEqual(buffer, buffer2)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('varIntSize', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('determines the varIntSize of ' + f.dec + ' correctly', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue