aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/Imports.cpp
diff options
context:
space:
mode:
authorVoR0220 <rj@erisindustries.com>2017-01-12 01:45:14 +0800
committerVoR0220 <rj@erisindustries.com>2017-01-12 01:45:14 +0800
commit4542f459f165502ed9537bb570de44640cdc4228 (patch)
tree36be3a43e4b04b30ea2903a48aea717d3ef6007d /test/libsolidity/Imports.cpp
parent4585bfdce7716cd4837f71b565bb9a6dff8c2d7e (diff)
downloaddexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.gz
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.tar.zst
dexon-solidity-4542f459f165502ed9537bb570de44640cdc4228.zip
added fix and a test for order independence of nested prefixing
Signed-off-by: VoR0220 <rj@erisindustries.com>
Diffstat (limited to 'test/libsolidity/Imports.cpp')
-rw-r--r--test/libsolidity/Imports.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index 7945f729..712f133a 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -183,6 +183,24 @@ BOOST_AUTO_TEST_CASE(context_dependent_remappings_ensure_default_and_module_pres
BOOST_CHECK(c.compile());
}
+BOOST_AUTO_TEST_CASE(context_dependent_remappings_order_independent)
+{
+ CompilerStack c;
+ c.setRemappings(vector<string>{"a:x/y/z=d", "a/b:x=e"});
+ c.addSource("a/main.sol", "import \"x/y/z/z.sol\"; contract Main is D {} pragma solidity >=0.0;");
+ c.addSource("a/b/main.sol", "import \"x/y/z/z.sol\"; contract Main is E {} pragma solidity >=0.0;");
+ c.addSource("x/y/z/z.sol", "contract D {} pragma solidity >=0.0;");
+ c.addSource("e/y/z/z.sol", "contract E {} pragma solidity >=0.0;");
+ BOOST_CHECK(c.compile());
+ CompilerStack d;
+ d.setRemappings(vector<string>{"a/b:x=e", "a:x/y/z=d"});
+ d.addSource("a/main.sol", "import \"x/y/z/z.sol\"; contract Main is D {} pragma solidity >=0.0;");
+ d.addSource("a/b/main.sol", "import \"x/y/z/z.sol\"; contract Main is E {} pragma solidity >=0.0;");
+ d.addSource("x/y/z/z.sol", "contract D {} pragma solidity >=0.0;");
+ d.addSource("e/y/z/z.sol", "contract E {} pragma solidity >=0.0;");
+ BOOST_CHECK(d.compile());
+}
+
BOOST_AUTO_TEST_SUITE_END()
}