bufferutils: add equal

This commit is contained in:
Daniel Cousens 2015-03-02 16:47:26 +11:00
parent 8d3686d046
commit 5beee20038
2 changed files with 27 additions and 0 deletions

View file

@ -77,6 +77,22 @@ describe('bufferutils', function () {
})
})
describe('equal', function () {
fixtures.valid.forEach(function (f) {
describe('for ' + f.hexVI, function () {
fixtures.valid.forEach(function (f2) {
it('equates the string comparison: ' + f.hexVI + ' === ' + f2.hexVI, function () {
var a = new Buffer(f.hexVI, 'hex')
var b = new Buffer(f2.hexVI, 'hex')
var expected = f.hexVI === f2.hexVI
assert.equal(bufferutils.equal(a, b), expected)
})
})
})
})
})
describe('reverse', function () {
fixtures.valid.forEach(function (f) {
it('reverses ' + f.hex64 + ' correctly', function () {