bufferutils: add varIntBuffer
This commit is contained in:
parent
c0c47f076a
commit
2214ccfdd8
4 changed files with 22 additions and 10 deletions
test
|
@ -88,6 +88,16 @@ describe('bufferutils', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('varIntBuffer', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('encodes ' + f.dec + ' correctly', function() {
|
||||
var buffer = bufferutils.varIntBuffer(f.dec)
|
||||
|
||||
assert.equal(buffer.toString('hex'), f.hexVI)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('varIntSize', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('determines the varIntSize of ' + f.dec + ' correctly', function() {
|
||||
|
@ -99,7 +109,7 @@ describe('bufferutils', function() {
|
|||
})
|
||||
|
||||
describe('writePushDataInt', function() {
|
||||
fixtures.valid.forEach(function(f, i) {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
if (!f.hexPD) return
|
||||
|
||||
it('encodes ' + f.dec + ' correctly', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue