From ff9fdfac57d8807399b1b1ddd5c69a819349251f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 3 Jan 2018 11:34:48 +0000 Subject: Properly handle colons in file names within jsonio --- test/libsolidity/StandardCompiler.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index dd0478c5..fa0f1e59 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -451,6 +451,36 @@ BOOST_AUTO_TEST_CASE(output_selection_dependent_contract_with_import) BOOST_CHECK_EQUAL(dev::jsonCompactPrint(contract["abi"]), "[{\"constant\":false,\"inputs\":[],\"name\":\"f\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"); } +BOOST_AUTO_TEST_CASE(filename_with_colon) +{ + char const* input = R"( + { + "language": "Solidity", + "settings": { + "outputSelection": { + "http://github.com/ethereum/solidity/std/StandardToken.sol": { + "A": [ + "abi" + ] + } + } + }, + "sources": { + "http://github.com/ethereum/solidity/std/StandardToken.sol": { + "content": "contract A { }" + } + } + } + )"; + Json::Value result = compile(input); + BOOST_CHECK(containsAtMostWarnings(result)); + Json::Value contract = getContractResult(result, "http://github.com/ethereum/solidity/std/StandardToken.sol", "A"); + BOOST_CHECK(contract.isObject()); + BOOST_CHECK(contract["abi"].isArray()); + BOOST_CHECK_EQUAL(dev::jsonCompactPrint(contract["abi"]), "[]"); +} + + BOOST_AUTO_TEST_SUITE_END() } -- cgit v1.2.3