diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-18 21:43:35 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-18 22:03:45 +0800 |
commit | d6a696830fbda5709e65fda0d6cae8bf2c911594 (patch) | |
tree | 6ff1cac40a64ad6f187a04c6eb5d734e27136cbb | |
parent | 00d6c1ac347b4f5e6d4b3883da862d6fafe11f4b (diff) | |
download | dexon-solidity-d6a696830fbda5709e65fda0d6cae8bf2c911594.tar.gz dexon-solidity-d6a696830fbda5709e65fda0d6cae8bf2c911594.tar.zst dexon-solidity-d6a696830fbda5709e65fda0d6cae8bf2c911594.zip |
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
-rw-r--r-- | solidityNatspecJSON.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/solidityNatspecJSON.cpp b/solidityNatspecJSON.cpp index 2c3ded08..5b48a67c 100644 --- a/solidityNatspecJSON.cpp +++ b/solidityNatspecJSON.cpp @@ -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" |