Skip to content

Commit

Permalink
tests: reject decimal input in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
axic authored and indutny committed Nov 29, 2017
1 parent e88e7b7 commit 9173bc2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/constructor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ describe('BN.js/Constructor', function () {
return new BN('01FF');
}, /^Error: Invalid character$/);
});

it('should not accept decimal', function () {
assert.throws(function () {
BN('10.00', 10);
});
assert.throws(function () {
BN('16.00', 16);
});
});
});

describe('with Array input', function () {
Expand Down

0 comments on commit 9173bc2

Please sign in to comment.