diff options
author | chriseth <c@ethdev.com> | 2016-06-08 01:44:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-06-09 00:16:46 +0800 |
commit | 3150ab2bcfe6ab66d426916fc1a003ae52799b72 (patch) | |
tree | b7fc2c8c910c97c883816364bd62bb7c646dd75b /test/libsolidity | |
parent | 63b63056893717a9ec4565ba6c1e7c746592054b (diff) | |
download | dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.gz dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.bz2 dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.lz dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.xz dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.zst dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.zip |
Allow remappings to change depending on the context.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/Imports.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp index 94d3e423..0736a853 100644 --- a/test/libsolidity/Imports.cpp +++ b/test/libsolidity/Imports.cpp @@ -142,6 +142,28 @@ BOOST_AUTO_TEST_CASE(name_clash_in_import) BOOST_CHECK(c.compile()); } +BOOST_AUTO_TEST_CASE(remappings) +{ + CompilerStack c; + c.setRemappings(vector<string>{"s=s_1.4.6", "t=Tee"}); + c.addSource("a", "import \"s/s.sol\"; contract A is S {}"); + c.addSource("b", "import \"t/tee.sol\"; contract A is Tee {} "); + c.addSource("s_1.4.6/s.sol", "contract S {}"); + c.addSource("Tee/tee.sol", "contract Tee {}"); + BOOST_CHECK(c.compile()); +} + +BOOST_AUTO_TEST_CASE(context_dependent_remappings) +{ + CompilerStack c; + c.setRemappings(vector<string>{"a:s=s_1.4.6", "b:s=s_1.4.7"}); + c.addSource("a/a.sol", "import \"s/s.sol\"; contract A is SSix {}"); + c.addSource("b/b.sol", "import \"s/s.sol\"; contract B is SSeven {}"); + c.addSource("s_1.4.6/s.sol", "contract SSix {} "); + c.addSource("s_1.4.7/s.sol", "contract SSeven {} "); + BOOST_CHECK(c.compile()); +} + BOOST_AUTO_TEST_SUITE_END() } |