You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
/* eslint-env node, mocha */
|
|
/* global artifacts, contract, assert */
|
|
|
|
const TotallyPure = artifacts.require('./TotallyPure.sol');
|
|
|
|
contract('TotallyPure', accounts => {
|
|
|
|
it('calls imported, inherited pure/view functions within its own function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
await instance.usesThem();
|
|
});
|
|
|
|
it('calls an imported, inherited pure function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.isPure(4,5);
|
|
});
|
|
|
|
it('calls an imported, inherited view function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.isView();
|
|
})
|
|
|
|
it('calls an imported, inherited constant function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.isConstant();
|
|
})
|
|
|
|
it('overrides an imported, inherited abstract pure function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.bePure(4,5);
|
|
})
|
|
|
|
it('overrides an imported, inherited abstract view function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.beView();
|
|
});
|
|
|
|
it('overrides an imported, inherited abstract constant function', async function(){
|
|
const instance = await TotallyPure.deployed();
|
|
const value = await instance.beConstant();
|
|
});
|
|
}); |