diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2017-01-27 19:13:14 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2017-01-27 19:13:14 +0800 |
commit | f01c8c07e5647e02a45ad0802578153c7273668a (patch) | |
tree | 083c4905c4be40c570b12580fecb6c35bc973eb7 /test/libsolidity/SolidityNatspecJSON.cpp | |
parent | 0e021e76a58d0ae7a7fe1647f079e7e5087b4641 (diff) | |
download | dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.gz dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.bz2 dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.lz dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.xz dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.zst dexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.zip |
Tests for natspect parsing failure cases
Diffstat (limited to 'test/libsolidity/SolidityNatspecJSON.cpp')
-rw-r--r-- | test/libsolidity/SolidityNatspecJSON.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp index 42b989dd..ac55382b 100644 --- a/test/libsolidity/SolidityNatspecJSON.cpp +++ b/test/libsolidity/SolidityNatspecJSON.cpp @@ -635,6 +635,48 @@ BOOST_AUTO_TEST_CASE(dev_documenting_nonexistent_param) expectNatspecError(sourceCode); } +BOOST_AUTO_TEST_CASE(dev_documenting_no_paramname) +{ + char const* sourceCode = R"( + contract test { + /// @dev Multiplies a number by 7 and adds second parameter + /// @param a Documentation for the first parameter + /// @param + function mul(uint a, uint second) returns(uint d) { return a * 7 + second; } + } + )"; + + expectNatspecError(sourceCode); +} + +BOOST_AUTO_TEST_CASE(dev_documenting_no_paramname_end) +{ + char const* sourceCode = R"( + contract test { + /// @dev Multiplies a number by 7 and adds second parameter + /// @param a Documentation for the first parameter + /// @param se + function mul(uint a, uint second) returns(uint d) { return a * 7 + second; } + } + )"; + + expectNatspecError(sourceCode); +} + +BOOST_AUTO_TEST_CASE(dev_documenting_no_param_description) +{ + char const* sourceCode = R"( + contract test { + /// @dev Multiplies a number by 7 and adds second parameter + /// @param a Documentation for the first parameter + /// @param second + function mul(uint a, uint second) returns(uint d) { return a * 7 + second; } + } + )"; + + expectNatspecError(sourceCode); +} + BOOST_AUTO_TEST_SUITE_END() } |