Skip to content

Commit

Permalink
test to verify encode and decode are inverses are more complicated input
Browse files Browse the repository at this point in the history
  • Loading branch information
kisonecat committed Nov 1, 2017
1 parent 5f4b88c commit 271c3a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ describe('BubbleBabble', function() {
}).should.throw;
});

it('should be inverse of encoding', function() {
it('should be inverse of encoding a string', function() {
var ascii_input = 'Inverse of each other.';

bubble.decode(bubble.encode(ascii_input)).toString().should.equal(ascii_input);
});

it('should be inverse of encoding a buffer', function() {
var input = Buffer.from('ffffffff','hex');

bubble.decode(bubble.encode(input)).equals(input).should.be.true;
});
});

});

0 comments on commit 271c3a8

Please sign in to comment.