Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Added test for decoding empty Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Feb 15, 2018
1 parent ecca372 commit 80516c4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ describe('zero values', function () {
})
})

describe('empty values', function () {
var encoded
it('decode empty buffer', function () {
decoded = RLP.decode(Buffer.from([]))
assert.deepEqual(decoded, Buffer.from([]))
})
})

describe('bad values', function () {
it('wrong encoded a zero', function () {
var val = Buffer.from('f9005f030182520894b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3', 'hex')
Expand Down

0 comments on commit 80516c4

Please sign in to comment.