aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityNatspecJSON.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2017-01-27 19:13:14 +0800
committerLefteris Karapetsas <lefteris@refu.co>2017-01-27 19:13:14 +0800
commitf01c8c07e5647e02a45ad0802578153c7273668a (patch)
tree083c4905c4be40c570b12580fecb6c35bc973eb7 /test/libsolidity/SolidityNatspecJSON.cpp
parent0e021e76a58d0ae7a7fe1647f079e7e5087b4641 (diff)
downloaddexon-solidity-f01c8c07e5647e02a45ad0802578153c7273668a.tar.gz
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.cpp42
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()
}