aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-01-18 16:24:11 +0800
committerchriseth <c@ethdev.com>2016-01-18 16:24:11 +0800
commit0099513cd430d82a62a7bff6737aef7efa829ee2 (patch)
tree0ae67aea24abc11e5da95aa98d60fd5b38789034 /test/libsolidity
parent2c5d045729f375ba386083dfd305f186d6d8577a (diff)
parent17199edb4f7011d062ae126f7910314ed490d2c7 (diff)
downloaddexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.gz
dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.zst
dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.zip
Merge pull request #347 from chriseth/libraryNameClashes
Detect library name clashes
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/Imports.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index c074b332..94d3e423 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -101,6 +101,22 @@ BOOST_AUTO_TEST_CASE(simple_alias)
BOOST_CHECK(c.compile());
}
+BOOST_AUTO_TEST_CASE(library_name_clash)
+{
+ CompilerStack c;
+ c.addSource("a", "library A {}");
+ c.addSource("b", "library A {}");
+ BOOST_CHECK(!c.compile());
+}
+
+BOOST_AUTO_TEST_CASE(library_name_clash_with_contract)
+{
+ CompilerStack c;
+ c.addSource("a", "contract A {}");
+ c.addSource("b", "library A {}");
+ BOOST_CHECK(c.compile());
+}
+
BOOST_AUTO_TEST_CASE(complex_import)
{
CompilerStack c;