mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Detect if non-existant parameter is documented with natspec
This commit is contained in:
parent
735c02c468
commit
d82a3ca956
@ -176,7 +176,6 @@ BOOST_AUTO_TEST_CASE(dev_and_user_no_doc)
|
|||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
char const* devNatspec = "{\"methods\":{}}";
|
char const* devNatspec = "{\"methods\":{}}";
|
||||||
|
|
||||||
char const* userNatspec = "{\"methods\":{}}";
|
char const* userNatspec = "{\"methods\":{}}";
|
||||||
|
|
||||||
checkNatspec(sourceCode, devNatspec, false);
|
checkNatspec(sourceCode, devNatspec, false);
|
||||||
@ -230,6 +229,18 @@ BOOST_AUTO_TEST_CASE(dev_multiple_params)
|
|||||||
checkNatspec(sourceCode, natspec, false);
|
checkNatspec(sourceCode, natspec, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
|
||||||
|
{
|
||||||
|
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 not_existing Documentation for the second parameter\n"
|
||||||
|
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
BOOST_CHECK_THROW(checkNatspec(sourceCode, natspec, false), DocstringParsingError);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(dev_mutiline_param_description)
|
BOOST_AUTO_TEST_CASE(dev_mutiline_param_description)
|
||||||
{
|
{
|
||||||
char const* sourceCode = "contract test {\n"
|
char const* sourceCode = "contract test {\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user