aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-10 00:35:20 +0800
committerchriseth <c@ethdev.com>2015-12-10 02:21:02 +0800
commitf8228e8ab116799a1b28ea9cbb01fdd7342b395c (patch)
tree182796217c88cdfa49b2dedf3c192f75dd7a8052 /test
parent7cb7818ceaf8f2e50cdd66b33a4e0d17c2a0e879 (diff)
downloaddexon-solidity-f8228e8ab116799a1b28ea9cbb01fdd7342b395c.tar.gz
dexon-solidity-f8228e8ab116799a1b28ea9cbb01fdd7342b395c.tar.zst
dexon-solidity-f8228e8ab116799a1b28ea9cbb01fdd7342b395c.zip
Relative paths in import directives.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/Imports.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index b5ff0c54..ab8e2257 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -76,6 +76,23 @@ BOOST_AUTO_TEST_CASE(circular_import)
BOOST_CHECK(c.compile());
}
+BOOST_AUTO_TEST_CASE(relative_import)
+{
+ CompilerStack c;
+ c.addSource("a", "import \"./dir/b\"; contract A is B {}");
+ c.addSource("dir/b", "contract B {}");
+ c.addSource("dir/c", "import \"../a\"; contract C is A {}");
+ BOOST_CHECK(c.compile());
+}
+
+BOOST_AUTO_TEST_CASE(relative_import_multiplex)
+{
+ CompilerStack c;
+ c.addSource("a", "contract A {}");
+ c.addSource("dir/a/b/c", "import \"../../.././a\"; contract B is A {}");
+ BOOST_CHECK(c.compile());
+}
+
BOOST_AUTO_TEST_SUITE_END()
}