Skip to content

Commit

Permalink
add byte array tests
Browse files Browse the repository at this point in the history
  • Loading branch information
beaugunderson committed Jul 23, 2015
1 parent c05ff37 commit 4fb6a95
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/functionality-v6-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ describe('v6', function () {
should.equal(topic.correctForm(), 'a:b:c:d:e:f:0:1');
});

it('converts to and from a signed byte array', function () {
var bytes = topic.toByteArray();
var address = v6.Address.fromByteArray(bytes);

address.correctForm().should.equal(topic.correctForm());
});

it('converts to and from an unsigned byte array', function () {
var unsignedBytes = topic.toUnsignedByteArray();
var address = v6.Address.fromUnsignedByteArray(unsignedBytes);

address.correctForm().should.equal(topic.correctForm());
});

it('gets the correct type', function () {
topic.getType().should.equal('Global unicast');

Expand Down

0 comments on commit 4fb6a95

Please sign in to comment.