tests: merge tests from BN.js