use varuint-bitcoin
This commit is contained in:
parent
038c0f08d2
commit
29a865788d
5 changed files with 26 additions and 102 deletions
test
|
@ -6,25 +6,6 @@ var bufferutils = require('../src/bufferutils')
|
|||
var fixtures = require('./fixtures/bufferutils.json')
|
||||
|
||||
describe('bufferutils', function () {
|
||||
// TODO: remove
|
||||
describe('equals', function () {
|
||||
it('works', function () {
|
||||
var a = new Buffer('abcd', 'hex')
|
||||
var b = new Buffer('bbbb', 'hex')
|
||||
|
||||
assert.strictEqual(bufferutils.equal(a, a), true)
|
||||
assert.strictEqual(bufferutils.equal(a, b), false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('reverse', function () {
|
||||
it('works', function () {
|
||||
var a = new Buffer('abcd', 'hex')
|
||||
|
||||
assert.strictEqual(bufferutils.reverse(a).toString('hex'), 'cdab')
|
||||
})
|
||||
})
|
||||
|
||||
describe('pushDataSize', function () {
|
||||
fixtures.valid.forEach(function (f) {
|
||||
it('determines the pushDataSize of ' + f.dec + ' correctly', function () {
|
||||
|
|
4
test/fixtures/bufferutils.json
vendored
4
test/fixtures/bufferutils.json
vendored
|
@ -86,14 +86,14 @@
|
|||
"readUInt64LE": [
|
||||
{
|
||||
"description": "n === 2^53",
|
||||
"exception": "value is larger than maximum value for type",
|
||||
"exception": "RangeError: value out of range",
|
||||
"hex64": "0000000000002000",
|
||||
"hexVI": "ff0000000000000020",
|
||||
"dec": 9007199254740992
|
||||
},
|
||||
{
|
||||
"description": "n > 2^53",
|
||||
"exception": "value is larger than maximum value for type",
|
||||
"exception": "RangeError: value out of range",
|
||||
"hex64": "0100000000002000",
|
||||
"hexVI": "ff0100000000000020",
|
||||
"dec": 9007199254740993
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue