2021-03-24 13:04:30 +00:00
|
|
|
describe('toZn', function () {
|
|
|
|
const inputs = [
|
|
|
|
{
|
|
|
|
a: BigInt(1),
|
|
|
|
n: BigInt(19),
|
|
|
|
toZn: BigInt(1)
|
|
|
|
},
|
|
|
|
{
|
2021-03-24 14:11:07 +00:00
|
|
|
a: -25,
|
2021-03-24 13:04:30 +00:00
|
|
|
n: BigInt(9),
|
|
|
|
toZn: BigInt(2)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
a: BigInt('12359782465012847510249'),
|
2021-03-24 14:11:07 +00:00
|
|
|
n: 5,
|
2021-03-24 13:04:30 +00:00
|
|
|
toZn: BigInt(4)
|
|
|
|
}
|
|
|
|
]
|
|
|
|
for (const input of inputs) {
|
|
|
|
describe(`toZn(${input.a}, ${input.n})`, function () {
|
|
|
|
it(`should return ${input.toZn}`, function () {
|
|
|
|
const ret = _pkg.toZn(input.a, input.n)
|
|
|
|
chai.expect(ret).to.equal(input.toZn)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|