Unverified Commit c7f2138d by Facundo Spagnuolo Committed by GitHub

Merge pull request #688 from AugustoL/refactor/reorganize-tests

Reorganize tests and add library folder
parents b0522b9c b67856c6
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
import "../token/ERC20Basic.sol"; import "../token/ERC20/ERC20Basic.sol";
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "../token/StandardToken.sol"; import "../token/StandardToken.sol";
import "../token/DetailedERC20.sol"; import "../token/ERC20/DetailedERC20.sol";
contract DetailedERC20Mock is StandardToken, DetailedERC20 { contract DetailedERC20Mock is StandardToken, DetailedERC20 {
......
pragma solidity ^0.4.13; pragma solidity ^0.4.13;
import "../token/ERC827Token.sol"; import "../token/ERC827/ERC827Token.sol";
// mock class using ERC827 Token // mock class using ERC827 Token
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "../token/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../token/SafeERC20.sol"; import "../token/ERC20/SafeERC20.sol";
contract ERC20FailingMock is ERC20 { contract ERC20FailingMock is ERC20 {
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "./Ownable.sol"; import "./Ownable.sol";
import "../token/ERC20Basic.sol"; import "../token/ERC20/ERC20Basic.sol";
import "../token/SafeERC20.sol"; import "../token/ERC20/SafeERC20.sol";
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "./ERC20Basic.sol"; import "./ERC20/ERC20Basic.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.13; pragma solidity ^0.4.13;
import "./ERC20.sol"; import "../ERC20/ERC20.sol";
/** /**
......
pragma solidity ^0.4.13; pragma solidity ^0.4.13;
import "./ERC827.sol"; import "./ERC827.sol";
import "./StandardToken.sol"; import "../StandardToken.sol";
/** /**
@title ERC827, an extension of ERC20 token standard @title ERC827, an extension of ERC20 token standard
......
...@@ -2,7 +2,7 @@ pragma solidity ^0.4.18; ...@@ -2,7 +2,7 @@ pragma solidity ^0.4.18;
import "./BasicToken.sol"; import "./BasicToken.sol";
import "./ERC20.sol"; import "./ERC20/ERC20.sol";
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "./ERC20Basic.sol"; import "./ERC20/SafeERC20.sol";
import "../token/SafeERC20.sol";
/** /**
......
pragma solidity ^0.4.18; pragma solidity ^0.4.18;
import "./ERC20Basic.sol"; import "./ERC20/ERC20Basic.sol";
import "./SafeERC20.sol"; import "./ERC20/SafeERC20.sol";
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
import decodeLogs from './helpers/decodeLogs'; import decodeLogs from '../helpers/decodeLogs';
const SimpleToken = artifacts.require('examples/SimpleToken.sol'); const SimpleToken = artifacts.require('SimpleToken.sol');
contract('SimpleToken', accounts => { contract('SimpleToken', accounts => {
let token; let token;
...@@ -23,7 +23,7 @@ contract('SimpleToken', accounts => { ...@@ -23,7 +23,7 @@ contract('SimpleToken', accounts => {
const decimals = await token.decimals(); const decimals = await token.decimals();
assert(decimals.eq(18)); assert(decimals.eq(18));
}); });
it('assigns the initial total supply to the creator', async function () { it('assigns the initial total supply to the creator', async function () {
const totalSupply = await token.totalSupply(); const totalSupply = await token.totalSupply();
const creatorBalance = await token.balanceOf(creator); const creatorBalance = await token.balanceOf(creator);
......
var ECRecoveryMock = artifacts.require('../contracts/mocks/ECRecoveryMock.sol'); var ECRecoveryMock = artifacts.require('ECRecoveryMock.sol');
var ECRecoveryLib = artifacts.require('../contracts/ECRecovery.sol'); var ECRecoveryLib = artifacts.require('ECRecovery.sol');
var hashMessage = require('./helpers/hashMessage.js'); var hashMessage = require('../helpers/hashMessage.js');
contract('ECRecovery', function (accounts) { contract('ECRecovery', function (accounts) {
let ecrecovery; let ecrecovery;
......
var MathMock = artifacts.require('./mocks/MathMock.sol'); var MathMock = artifacts.require('../mocks/MathMock.sol');
contract('Math', function (accounts) { contract('Math', function (accounts) {
let math; let math;
......
import MerkleTree from './helpers/merkleTree.js'; import MerkleTree from '../helpers/merkleTree.js';
import { sha3, bufferToHex } from 'ethereumjs-util'; import { sha3, bufferToHex } from 'ethereumjs-util';
var MerkleProof = artifacts.require('./MerkleProof.sol'); var MerkleProof = artifacts.require('MerkleProof.sol');
contract('MerkleProof', function (accounts) { contract('MerkleProof', function (accounts) {
let merkleProof; let merkleProof;
......
...@@ -5,7 +5,7 @@ require('chai') ...@@ -5,7 +5,7 @@ require('chai')
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
const DetailedERC20Mock = artifacts.require('mocks/DetailedERC20Mock.sol'); const DetailedERC20Mock = artifacts.require('DetailedERC20Mock.sol');
contract('DetailedERC20', accounts => { contract('DetailedERC20', accounts => {
let detailedERC20 = null; let detailedERC20 = null;
......
import EVMThrow from '../helpers/EVMThrow'; import EVMThrow from '../../helpers/EVMThrow';
require('chai') require('chai')
.use(require('chai-as-promised')) .use(require('chai-as-promised'))
.should(); .should();
const SafeERC20Helper = artifacts.require('mocks/SafeERC20Helper.sol'); const SafeERC20Helper = artifacts.require('SafeERC20Helper.sol');
contract('SafeERC20', function () { contract('SafeERC20', function () {
beforeEach(async function () { beforeEach(async function () {
......
import EVMRevert from './helpers/EVMRevert'; import EVMRevert from '../../helpers/EVMRevert';
var Message = artifacts.require('./mock/MessageHelper.sol'); var Message = artifacts.require('MessageHelper.sol');
var ERC827TokenMock = artifacts.require('./mock/ERC827TokenMock.sol'); var ERC827TokenMock = artifacts.require('ERC827TokenMock.sol');
var BigNumber = web3.BigNumber; var BigNumber = web3.BigNumber;
var _ = require('lodash'); var _ = require('lodash');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment