SolidityNatspecJSON: A few tweaks and small fixes before automatic conversion

- Expectation order matching the order of contracts in the source
- Typos in test names
- Redundant prefixes in test names
- Wrong 'king' in some expectations (it's not checked by the test suite)
This commit is contained in:
Kamil Śliwak 2023-08-09 17:42:41 +02:00
parent 91cc72bcd4
commit 1041f071f0

View File

@ -788,7 +788,7 @@ BOOST_AUTO_TEST_CASE(emit_same_signature_event_different_libraries)
"details": "This should not appear in Contract C dev doc" "details": "This should not appear in Contract C dev doc"
} }
}, },
"kind": "user", "kind": "dev",
"methods": {}, "methods": {},
"version": 1 "version": 1
} }
@ -1042,9 +1042,9 @@ BOOST_AUTO_TEST_CASE(event_inheritance_interface)
"methods": {} "methods": {}
} }
)ABCDEF"; )ABCDEF";
checkNatspec(sourceCode, "ERC20", devDoc, false);
checkNatspec(sourceCode, "A", devDoc, false); checkNatspec(sourceCode, "A", devDoc, false);
checkNatspec(sourceCode, "B", devDoc, false); checkNatspec(sourceCode, "B", devDoc, false);
checkNatspec(sourceCode, "ERC20", devDoc, false);
char const* userDoc = R"ABCDEF( char const* userDoc = R"ABCDEF(
{ {
@ -1058,9 +1058,9 @@ BOOST_AUTO_TEST_CASE(event_inheritance_interface)
"methods": {} "methods": {}
} }
)ABCDEF"; )ABCDEF";
checkNatspec(sourceCode, "ERC20", userDoc, true);
checkNatspec(sourceCode, "A", userDoc, true); checkNatspec(sourceCode, "A", userDoc, true);
checkNatspec(sourceCode, "B", userDoc, true); checkNatspec(sourceCode, "B", userDoc, true);
checkNatspec(sourceCode, "ERC20", userDoc, true);
} }
BOOST_AUTO_TEST_CASE(event_inheritance) BOOST_AUTO_TEST_CASE(event_inheritance)
@ -1098,9 +1098,9 @@ BOOST_AUTO_TEST_CASE(event_inheritance)
"methods": {} "methods": {}
} }
)ABCDEF"; )ABCDEF";
checkNatspec(sourceCode, "ERC20", devDoc, false);
checkNatspec(sourceCode, "A", devDoc, false); checkNatspec(sourceCode, "A", devDoc, false);
checkNatspec(sourceCode, "B", devDoc, false); checkNatspec(sourceCode, "B", devDoc, false);
checkNatspec(sourceCode, "ERC20", devDoc, false);
char const* userDoc = R"ABCDEF( char const* userDoc = R"ABCDEF(
{ {
@ -1114,9 +1114,9 @@ BOOST_AUTO_TEST_CASE(event_inheritance)
"methods": {} "methods": {}
} }
)ABCDEF"; )ABCDEF";
checkNatspec(sourceCode, "ERC20", userDoc, true);
checkNatspec(sourceCode, "A", userDoc, true); checkNatspec(sourceCode, "A", userDoc, true);
checkNatspec(sourceCode, "B", userDoc, true); checkNatspec(sourceCode, "B", userDoc, true);
checkNatspec(sourceCode, "ERC20", userDoc, true);
} }
BOOST_AUTO_TEST_CASE(dev_desc_after_nl) BOOST_AUTO_TEST_CASE(dev_desc_after_nl)
@ -1578,7 +1578,7 @@ BOOST_AUTO_TEST_CASE(dev_multiline_comment)
checkNatspec(sourceCode, "test", natspec, false); checkNatspec(sourceCode, "test", natspec, false);
} }
BOOST_AUTO_TEST_CASE(dev_documenting_no_return_paramname) BOOST_AUTO_TEST_CASE(dev_documenting_no_return_param_name)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
@ -1721,7 +1721,7 @@ BOOST_AUTO_TEST_CASE(enum_no_docs)
checkNatspec(sourceCode, "C", userDoc, true); checkNatspec(sourceCode, "C", userDoc, true);
} }
BOOST_AUTO_TEST_CASE(natspec_notice_without_tag) BOOST_AUTO_TEST_CASE(notice_without_tag)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
@ -1745,7 +1745,7 @@ BOOST_AUTO_TEST_CASE(natspec_notice_without_tag)
checkNatspec(sourceCode, "test", natspec, true); checkNatspec(sourceCode, "test", natspec, true);
} }
BOOST_AUTO_TEST_CASE(natspec_multiline_notice_without_tag) BOOST_AUTO_TEST_CASE(multiline_notice_without_tag)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
@ -1815,7 +1815,7 @@ BOOST_AUTO_TEST_CASE(dev_documenting_nonexistent_param)
expectNatspecError(sourceCode); expectNatspecError(sourceCode);
} }
BOOST_AUTO_TEST_CASE(dev_documenting_no_paramname) BOOST_AUTO_TEST_CASE(dev_documenting_no_param_name)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
@ -1829,7 +1829,7 @@ BOOST_AUTO_TEST_CASE(dev_documenting_no_paramname)
expectNatspecError(sourceCode); expectNatspecError(sourceCode);
} }
BOOST_AUTO_TEST_CASE(dev_documenting_no_paramname_end) BOOST_AUTO_TEST_CASE(dev_documenting_no_param_name_end)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
@ -2771,7 +2771,7 @@ BOOST_AUTO_TEST_CASE(user_inherit_parameter_mismatch)
checkNatspec(sourceCode, "Token", natspec2, true); checkNatspec(sourceCode, "Token", natspec2, true);
} }
BOOST_AUTO_TEST_CASE(dev_explicit_inehrit_complex) BOOST_AUTO_TEST_CASE(dev_explicit_inherit_complex)
{ {
char const *sourceCode1 = R"( char const *sourceCode1 = R"(
interface ERC20 { interface ERC20 {