aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2016-11-30 22:04:07 +0800
committerLefteris Karapetsas <lefteris@refu.co>2017-01-25 18:01:52 +0800
commit5738e865d5375751332d8f884f2b00b006d76945 (patch)
tree4410e741f94f81235d9304e47e3db3d979896cc5 /test
parentba9a04500217e301bec63cab4e0c0f1d9322646d (diff)
downloaddexon-solidity-5738e865d5375751332d8f884f2b00b006d76945.tar.gz
dexon-solidity-5738e865d5375751332d8f884f2b00b006d76945.tar.zst
dexon-solidity-5738e865d5375751332d8f884f2b00b006d76945.zip
Accept any kind of whitespace after natspec tags
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNatspecJSON.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp
index e32264c4..c59b30c3 100644
--- a/test/libsolidity/SolidityNatspecJSON.cpp
+++ b/test/libsolidity/SolidityNatspecJSON.cpp
@@ -251,6 +251,29 @@ BOOST_AUTO_TEST_CASE(dev_multiple_params)
checkNatspec(sourceCode, natspec, false);
}
+BOOST_AUTO_TEST_CASE(dev_multiple_params_mixed_whitespace)
+{
+ char const* sourceCode = "contract test {\n"
+ " /// @dev Multiplies a number by 7 and adds second parameter\n"
+ " /// @param a Documentation for the first parameter\n"
+ " /// @param second Documentation for the second parameter\n"
+ " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
+ "}\n";
+
+ char const* natspec = "{"
+ "\"methods\":{"
+ " \"mul(uint256,uint256)\":{ \n"
+ " \"details\": \"Multiplies a number by 7 and adds second parameter\",\n"
+ " \"params\": {\n"
+ " \"a\": \"Documentation for the first parameter\",\n"
+ " \"second\": \"Documentation for the second parameter\"\n"
+ " }\n"
+ " }\n"
+ "}}";
+
+ checkNatspec(sourceCode, natspec, false);
+}
+
BOOST_AUTO_TEST_CASE(dev_mutiline_param_description)
{
char const* sourceCode = R"(