Merge pull request #12551 from ethereum/natspec-test

Add test for fixed natspec ICE
This commit is contained in:
Leo 2022-02-14 19:51:03 +01:00 committed by GitHub
commit e3e77c0f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2582,6 +2582,55 @@ BOOST_AUTO_TEST_CASE(dev_struct_getter_override)
checkNatspec(sourceCode, "Thing", natspec2, false);
}
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_no_return_name)
{
char const *sourceCode = R"(
interface IThing {
///@return
function value(uint) external returns (uint128,uint128);
}
contract Thing is IThing {
struct Value {
uint128 x;
uint128 A;
}
mapping(uint=>Value) public override value;
}
)";
char const *natspec = R"ABCDEF({
"methods":
{
"value(uint256)":
{
"returns":
{
"_0": ""
}
}
}
})ABCDEF";
char const *natspec2 = R"ABCDEF({
"methods": {},
"stateVariables":
{
"value":
{
"return": "x ",
"returns":
{
"x": ""
}
}
}
})ABCDEF";
checkNatspec(sourceCode, "IThing", natspec, false);
checkNatspec(sourceCode, "Thing", natspec2, false);
}
BOOST_AUTO_TEST_CASE(dev_struct_getter_override_different_return_parameter_names)
{
char const *sourceCode = R"(