aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityNatspecJSON.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-01-13 16:54:44 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-01-13 16:54:44 +0800
commit09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6 (patch)
tree2c3ac55e12405bbdad6cbc1f05ddf8f88bd11dc7 /SolidityNatspecJSON.cpp
parentc028ad2949b5a8a53696ba4393e54528d42d00f8 (diff)
parent3e172da03f0d24dd594fdf91dba2b1a8689da6d5 (diff)
downloaddexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar.gz
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar.bz2
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar.lz
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar.xz
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.tar.zst
dexon-solidity-09c22efee2d7cd36cbc5cbc26f1d9d351cc31fa6.zip
Merge remote-tracking branch 'upstream/develop' into randomtests
Diffstat (limited to 'SolidityNatspecJSON.cpp')
-rw-r--r--SolidityNatspecJSON.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/SolidityNatspecJSON.cpp b/SolidityNatspecJSON.cpp
index f6a33247..7edb97a7 100644
--- a/SolidityNatspecJSON.cpp
+++ b/SolidityNatspecJSON.cpp
@@ -510,6 +510,19 @@ BOOST_AUTO_TEST_CASE(dev_title_at_function_error)
BOOST_CHECK_THROW(checkNatspec(sourceCode, natspec, false), DocstringParsingError);
}
+// test for bug where having no tags in docstring would cause infinite loop
+BOOST_AUTO_TEST_CASE(natspec_no_tags)
+{
+ char const* sourceCode = "contract test {\n"
+ " /// I do something awesome\n"
+ " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
+ "}\n";
+
+ char const* natspec = "{\"methods\": {}}";
+
+ checkNatspec(sourceCode, natspec, false);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}