diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-04-04 08:39:55 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-04-10 08:22:58 +0800 |
commit | 61fc3346c2fe2adc33dfe84aa50780d61e10efdf (patch) | |
tree | 1f5ab2cddf7093db8f8fb419ef70da66a9997c7b /packages/deployer/test/compiler_utils_test.ts | |
parent | 073bf738ddb271b6b4158798baf4cac3cb0608e9 (diff) | |
download | dexon-sol-tools-61fc3346c2fe2adc33dfe84aa50780d61e10efdf.tar.gz dexon-sol-tools-61fc3346c2fe2adc33dfe84aa50780d61e10efdf.tar.zst dexon-sol-tools-61fc3346c2fe2adc33dfe84aa50780d61e10efdf.zip |
Updated deployer to accept a list of contract directories as input. Contract directories are namespaced to a void clashes. Also in this commit is a fix for overloading contract functions.
Diffstat (limited to 'packages/deployer/test/compiler_utils_test.ts')
-rw-r--r-- | packages/deployer/test/compiler_utils_test.ts | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/packages/deployer/test/compiler_utils_test.ts b/packages/deployer/test/compiler_utils_test.ts index 246304858..5377d3308 100644 --- a/packages/deployer/test/compiler_utils_test.ts +++ b/packages/deployer/test/compiler_utils_test.ts @@ -47,28 +47,34 @@ describe('Compiler utils', () => { }); describe('#parseDependencies', () => { it('correctly parses Exchange dependencies', async () => { - const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/Exchange.sol`, { + const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/main/Exchange.sol`, { encoding: 'utf8', }); - expect(parseDependencies(exchangeSource)).to.be.deep.equal([ - 'TokenTransferProxy.sol', - 'Token.sol', - 'SafeMath.sol', + const sourceFileId = '/main/Exchange.sol'; + expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([ + '/main/TokenTransferProxy.sol', + '/base/Token.sol', + '/base/SafeMath.sol', ]); }); it('correctly parses TokenTransferProxy dependencies', async () => { const exchangeSource = await fsWrapper.readFileAsync( - `${__dirname}/fixtures/contracts/TokenTransferProxy.sol`, + `${__dirname}/fixtures/contracts/main/TokenTransferProxy.sol`, { encoding: 'utf8', }, ); - expect(parseDependencies(exchangeSource)).to.be.deep.equal(['Token.sol', 'Ownable.sol']); + const sourceFileId = '/main/TokenTransferProxy.sol'; + expect(parseDependencies(exchangeSource, sourceFileId)).to.be.deep.equal([ + '/base/Token.sol', + '/base/Ownable.sol', + ]); }); // TODO: For now that doesn't work. This will work after we switch to a grammar-based parser it.skip('correctly parses commented out dependencies', async () => { const contractWithCommentedOutDependencies = `// import "./TokenTransferProxy.sol";`; - expect(parseDependencies(contractWithCommentedOutDependencies)).to.be.deep.equal([]); + const sourceFileId = '/main/TokenTransferProxy.sol'; + expect(parseDependencies(contractWithCommentedOutDependencies, sourceFileId)).to.be.deep.equal([]); }); }); }); |