Files
openzeppelin-contracts/test/library/Math.test.js
Federico Gimenez f4bdaf49a1 Increase test coverage to 93% #549 (#768)
* Increase test coverage to 93% #549

* cover missing AllowanceCrowdsale branch

* improve Heritable coverage

* fix lint errors

* proper equal assert

* address review comments

* remove unneeded const definitions and imports

* use assertRevert

* reword scenario description

* Increase test coverage to 93% #549

* cover missing AllowanceCrowdsale branch

* improve Heritable coverage

* fix lint errors

* proper equal assert

* address review comments

* remove unneeded const definitions and imports

* use assertRevert

* reword scenario description

* move HIGH_GOAL constant to the scope where it's used

* remove const at top level

* address review comments
2018-04-17 15:05:34 -03:00

44 lines
947 B
JavaScript

var MathMock = artifacts.require('MathMock');
contract('Math', function (accounts) {
let math;
before(async function () {
math = await MathMock.new();
});
it('returns max64 correctly', async function () {
let a = 5678;
let b = 1234;
await math.max64(a, b);
let result = await math.result64();
assert.equal(result, a);
});
it('returns min64 correctly', async function () {
let a = 5678;
let b = 1234;
await math.min64(a, b);
let result = await math.result64();
assert.equal(result, b);
});
it('returns max256 correctly', async function () {
let a = 5678;
let b = 1234;
await math.max256(a, b);
let result = await math.result256();
assert.equal(result, a);
});
it('returns min256 correctly', async function () {
let a = 5678;
let b = 1234;
await math.min256(a, b);
let result = await math.result256();
assert.equal(result, b);
});
});