Files
openzeppelin-contracts/test/library/Math.test.js
Francisco Giordano bf34911857 Remove Math.min64 and Math.max64 (#1156)
* remove Math.min64 and Math.max64

* refactor Math tests to use return values

* enhance Math coverage
2018-08-06 15:18:19 -03:00

35 lines
972 B
JavaScript

const MathMock = artifacts.require('MathMock');
contract('Math', function () {
const min = 1234;
const max = 5678;
beforeEach(async function () {
this.math = await MathMock.new();
});
describe('max', function () {
it('is correctly detected in first argument position', async function () {
const result = await this.math.max(max, min);
assert.equal(result, max);
});
it('is correctly detected in second argument position', async function () {
const result = await this.math.max(min, max);
assert.equal(result, max);
});
});
describe('min', function () {
it('is correctly detected in first argument position', async function () {
const result = await this.math.min(min, max);
assert.equal(result, min);
});
it('is correctly detected in second argument position', async function () {
const result = await this.math.min(max, min);
assert.equal(result, min);
});
});
});