diff options
author | chriseth <c@ethdev.com> | 2016-01-18 16:24:11 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-01-18 16:24:11 +0800 |
commit | 0099513cd430d82a62a7bff6737aef7efa829ee2 (patch) | |
tree | 0ae67aea24abc11e5da95aa98d60fd5b38789034 /test | |
parent | 2c5d045729f375ba386083dfd305f186d6d8577a (diff) | |
parent | 17199edb4f7011d062ae126f7910314ed490d2c7 (diff) | |
download | dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.gz dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.bz2 dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.lz dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.xz dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.tar.zst dexon-solidity-0099513cd430d82a62a7bff6737aef7efa829ee2.zip |
Merge pull request #347 from chriseth/libraryNameClashes
Detect library name clashes
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/Imports.cpp | 16 |
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; |