aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-06 06:54:59 +0800
committerGitHub <noreply@github.com>2018-01-06 06:54:59 +0800
commitcf4fdab134366d36d2614fc549eadf149e8ee82b (patch)
treebcdc2cb13d9b1e621d15571259672ce0b32da2e4 /test
parent35095e9fcc53f76a1c73251497c265f399a9896c (diff)
parent9e7e312fdfc2598d0bd43efc72738845bf2e3992 (diff)
downloaddexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar.gz
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar.bz2
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar.lz
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar.xz
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.tar.zst
dexon-solidity-cf4fdab134366d36d2614fc549eadf149e8ee82b.zip
Merge pull request #3380 from ethereum/jsonio-colon
Properly support library file names containing a colon (such as URLs).
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/StandardCompiler.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp
index fa0f1e59..e48624e5 100644
--- a/test/libsolidity/StandardCompiler.cpp
+++ b/test/libsolidity/StandardCompiler.cpp
@@ -480,6 +480,41 @@ BOOST_AUTO_TEST_CASE(filename_with_colon)
BOOST_CHECK_EQUAL(dev::jsonCompactPrint(contract["abi"]), "[]");
}
+BOOST_AUTO_TEST_CASE(library_filename_with_colon)
+{
+ char const* input = R"(
+ {
+ "language": "Solidity",
+ "settings": {
+ "outputSelection": {
+ "fileA": {
+ "A": [
+ "evm.bytecode"
+ ]
+ }
+ }
+ },
+ "sources": {
+ "fileA": {
+ "content": "import \"git:library.sol\"; contract A { function f() returns (uint) { return L.g(); } }"
+ },
+ "git:library.sol": {
+ "content": "library L { function g() returns (uint) { return 1; } }"
+ }
+ }
+ }
+ )";
+ Json::Value result = compile(input);
+ BOOST_CHECK(containsAtMostWarnings(result));
+ Json::Value contract = getContractResult(result, "fileA", "A");
+ BOOST_CHECK(contract.isObject());
+ BOOST_CHECK(contract["evm"]["bytecode"].isObject());
+ BOOST_CHECK(contract["evm"]["bytecode"]["linkReferences"].isObject());
+ BOOST_CHECK(contract["evm"]["bytecode"]["linkReferences"]["git:library.sol"].isObject());
+ BOOST_CHECK(contract["evm"]["bytecode"]["linkReferences"]["git:library.sol"]["L"].isArray());
+ BOOST_CHECK(contract["evm"]["bytecode"]["linkReferences"]["git:library.sol"]["L"][0].isObject());
+}
+
BOOST_AUTO_TEST_SUITE_END()