* All tests now use account names, and dont use accounts[0] (except ERC721) * Added account names to some missing contracts.
44 lines
969 B
JavaScript
44 lines
969 B
JavaScript
const MathMock = artifacts.require('MathMock');
|
|
|
|
contract('Math', function () {
|
|
let math;
|
|
|
|
beforeEach(async function () {
|
|
math = await MathMock.new();
|
|
});
|
|
|
|
it('returns max64 correctly', async function () {
|
|
const a = 5678;
|
|
const b = 1234;
|
|
await math.max64(a, b);
|
|
const result = await math.result64();
|
|
assert.equal(result, a);
|
|
});
|
|
|
|
it('returns min64 correctly', async function () {
|
|
const a = 5678;
|
|
const b = 1234;
|
|
await math.min64(a, b);
|
|
const result = await math.result64();
|
|
|
|
assert.equal(result, b);
|
|
});
|
|
|
|
it('returns max256 correctly', async function () {
|
|
const a = 5678;
|
|
const b = 1234;
|
|
await math.max256(a, b);
|
|
const result = await math.result256();
|
|
assert.equal(result, a);
|
|
});
|
|
|
|
it('returns min256 correctly', async function () {
|
|
const a = 5678;
|
|
const b = 1234;
|
|
await math.min256(a, b);
|
|
const result = await math.result256();
|
|
|
|
assert.equal(result, b);
|
|
});
|
|
});
|