mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Changes in InterfaceHandler to deal with multiline natspec
- Also now Solidity scanner considers Carriage Return as whitespace - Tests for Natspec generation with the new multiline comments
This commit is contained in:
parent
00d6c1ac34
commit
d6a696830f
@ -394,6 +394,35 @@ BOOST_AUTO_TEST_CASE(dev_multiline_return)
|
||||
checkNatspec(sourceCode, natspec, false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(dev_multiline_comment)
|
||||
{
|
||||
char const* sourceCode = "contract test {\n"
|
||||
" /**\n"
|
||||
" * @dev Multiplies a number by 7 and adds second parameter\n"
|
||||
" * @param a Documentation for the first parameter starts here.\n"
|
||||
" * Since it's a really complicated parameter we need 2 lines\n"
|
||||
" * @param second Documentation for the second parameter\n"
|
||||
" * @return The result of the multiplication\n"
|
||||
" * and cookies with nutella\n"
|
||||
" */"
|
||||
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
||||
"}\n";
|
||||
|
||||
char const* natspec = "{"
|
||||
"\"methods\":{"
|
||||
" \"mul\":{ \n"
|
||||
" \"details\": \"Multiplies a number by 7 and adds second parameter\",\n"
|
||||
" \"params\": {\n"
|
||||
" \"a\": \"Documentation for the first parameter starts here. Since it's a really complicated parameter we need 2 lines\",\n"
|
||||
" \"second\": \"Documentation for the second parameter\"\n"
|
||||
" },\n"
|
||||
" \"return\": \"The result of the multiplication and cookies with nutella\"\n"
|
||||
" }\n"
|
||||
"}}";
|
||||
|
||||
checkNatspec(sourceCode, natspec, false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(dev_contract_no_doc)
|
||||
{
|
||||
char const* sourceCode = "contract test {\n"
|
||||
|
Loading…
Reference in New Issue
Block a user