From 9173bc28b088ce9db14bfc658380ab0aa5404a40 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 19 Dec 2015 22:38:39 +0000 Subject: [PATCH] tests: reject decimal input in constructor --- test/constructor-test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/constructor-test.js b/test/constructor-test.js index 713a44a..caae696 100644 --- a/test/constructor-test.js +++ b/test/constructor-test.js @@ -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 () {