aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVoR0220 <rj@erisindustries.com>2017-01-05 08:29:54 +0800
committerVoR0220 <rj@erisindustries.com>2017-01-09 12:53:51 +0800
commit4f62980d52daa58f21dad3ef7caca5f854395c38 (patch)
tree0f785d2c6477646064ac8063ef148c7c44ef1547
parenta4d7a590ea0a38c3418cca50192e5fcedf38a8fb (diff)
downloaddexon-solidity-4f62980d52daa58f21dad3ef7caca5f854395c38.tar.gz
dexon-solidity-4f62980d52daa58f21dad3ef7caca5f854395c38.tar.zst
dexon-solidity-4f62980d52daa58f21dad3ef7caca5f854395c38.zip
added test
Signed-off-by: VoR0220 <rj@erisindustries.com>
-rw-r--r--test/libsolidity/Imports.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index e3f0b281..33978b1f 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -172,6 +172,17 @@ BOOST_AUTO_TEST_CASE(filename_with_period)
BOOST_CHECK(!c.compile());
}
+BOOST_AUTO_TEST_CASE(context_dependent_remappings_ensure_default_and_module_preserved)
+{
+ CompilerStack c;
+ c.setRemappings(vector<string>{"foo=vendor/foo_2.0.0", "vendor/bar:foo=vendor/foo_1.0.0", "bar=vendor/bar"});
+ c.addSource("main.sol", "import \"foo/foo.sol\"; import {Bar} \"bar/bar.sol\"; contract Main is Foo2, Bar {} pragma solidity >=0.0;");
+ c.addSource("vendor/bar/bar.sol", "import \"foo/foo.sol\"; contract Bar is Foo1 {} pragma solidity >=0.0;");
+ c.addSource("vendor/foo_1.0.0/foo.sol", "contract Foo1 {} pragma solidity >=0.0;");
+ c.addSource("vendor/foo_2.0.0/foo.sol", "contract Foo2 {} pragma solidity >=0.0;");
+ BOOST_CHECK(c.compile());
+}
+
BOOST_AUTO_TEST_SUITE_END()
}