mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make formatting more consistent in natspec tests
This commit is contained in:
parent
6d05912d70
commit
be7c7dd4a9
@ -119,7 +119,8 @@ BOOST_AUTO_TEST_CASE(user_newline_break)
|
||||
|
||||
char const* natspec = R"ABCDEF(
|
||||
{
|
||||
"methods": {
|
||||
"methods":
|
||||
{
|
||||
"f()":
|
||||
{
|
||||
"notice": "world"
|
||||
@ -147,8 +148,10 @@ BOOST_AUTO_TEST_CASE(user_multiline_empty_lines)
|
||||
|
||||
char const* natspec = R"ABCDEF(
|
||||
{
|
||||
"methods": {
|
||||
"f()": {
|
||||
"methods":
|
||||
{
|
||||
"f()":
|
||||
{
|
||||
"notice": "hello world"
|
||||
}
|
||||
}
|
||||
@ -644,8 +647,10 @@ BOOST_AUTO_TEST_CASE(dev_return_no_params)
|
||||
|
||||
char const* natspec = R"ABCDEF(
|
||||
{
|
||||
"methods": {
|
||||
"mul(uint256,uint256)": {
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256,uint256)":
|
||||
{
|
||||
"returns": { "d": "The result of the multiplication" }
|
||||
}
|
||||
}
|
||||
@ -879,7 +884,8 @@ BOOST_AUTO_TEST_CASE(dev_multiline_return)
|
||||
char const* natspec = R"R({
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256,uint256)": {
|
||||
"mul(uint256,uint256)":
|
||||
{
|
||||
"details": "Multiplies a number by 7 and adds second parameter",
|
||||
"params":
|
||||
{
|
||||
@ -1024,13 +1030,14 @@ BOOST_AUTO_TEST_CASE(natspec_notice_without_tag)
|
||||
|
||||
char const* natspec = R"ABCDEF(
|
||||
{
|
||||
"methods" : {
|
||||
"mul(uint256)" : {
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256)":
|
||||
{
|
||||
"notice": "I do something awesome"
|
||||
}
|
||||
}
|
||||
}
|
||||
)ABCDEF";
|
||||
})ABCDEF";
|
||||
|
||||
checkNatspec(sourceCode, "test", natspec, true);
|
||||
}
|
||||
@ -1047,8 +1054,10 @@ BOOST_AUTO_TEST_CASE(natspec_multiline_notice_without_tag)
|
||||
|
||||
char const* natspec = R"ABCDEF(
|
||||
{
|
||||
"methods" : {
|
||||
"mul(uint256)" : {
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256)":
|
||||
{
|
||||
"notice": "I do something awesome which requires two lines to explain"
|
||||
}
|
||||
}
|
||||
@ -1155,8 +1164,10 @@ BOOST_AUTO_TEST_CASE(user_constructor)
|
||||
)";
|
||||
|
||||
char const* natspec = R"ABCDEF({
|
||||
"methods": {
|
||||
"constructor" : {
|
||||
"methods":
|
||||
{
|
||||
"constructor":
|
||||
{
|
||||
"notice": "this is a really nice constructor"
|
||||
}
|
||||
}
|
||||
@ -1177,11 +1188,14 @@ BOOST_AUTO_TEST_CASE(user_constructor_and_function)
|
||||
)";
|
||||
|
||||
char const* natspec = R"ABCDEF({
|
||||
"methods" : {
|
||||
"mul(uint256,uint256)" : {
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256,uint256)":
|
||||
{
|
||||
"notice": "another multiplier"
|
||||
},
|
||||
"constructor" : {
|
||||
"constructor":
|
||||
{
|
||||
"notice": "this is a really nice constructor"
|
||||
}
|
||||
}
|
||||
@ -1201,9 +1215,12 @@ BOOST_AUTO_TEST_CASE(dev_constructor)
|
||||
)";
|
||||
|
||||
char const *natspec = R"ABCDEF({
|
||||
"methods" : {
|
||||
"constructor" : {
|
||||
"params" : {
|
||||
"methods":
|
||||
{
|
||||
"constructor":
|
||||
{
|
||||
"params":
|
||||
{
|
||||
"a": "the parameter a is really nice and very useful",
|
||||
"second": "the second parameter is not very useful, it just provides additional confusion"
|
||||
}
|
||||
@ -1248,19 +1265,25 @@ BOOST_AUTO_TEST_CASE(dev_constructor_and_function)
|
||||
)";
|
||||
|
||||
char const *natspec = R"ABCDEF({
|
||||
"methods" : {
|
||||
"mul(uint256,uint256)" : {
|
||||
"methods":
|
||||
{
|
||||
"mul(uint256,uint256)":
|
||||
{
|
||||
"details": "Multiplies a number by 7 and adds second parameter",
|
||||
"params" : {
|
||||
"params":
|
||||
{
|
||||
"a": "Documentation for the first parameter starts here. Since it's a really complicated parameter we need 2 lines",
|
||||
"second": "Documentation for the second parameter"
|
||||
},
|
||||
"returns" : {
|
||||
"returns":
|
||||
{
|
||||
"d": "The result of the multiplication and cookies with nutella"
|
||||
}
|
||||
},
|
||||
"constructor" : {
|
||||
"params" : {
|
||||
"constructor":
|
||||
{
|
||||
"params":
|
||||
{
|
||||
"a": "the parameter a is really nice and very useful",
|
||||
"second": "the second parameter is not very useful, it just provides additional confusion"
|
||||
}
|
||||
@ -1312,7 +1335,8 @@ BOOST_AUTO_TEST_CASE(slash3_slash3)
|
||||
)";
|
||||
|
||||
char const* natspec = R"ABCDEF({
|
||||
"methods": {
|
||||
"methods":
|
||||
{
|
||||
"f()": { "notice": "lorem ipsum" }
|
||||
}
|
||||
})ABCDEF";
|
||||
@ -1331,7 +1355,8 @@ BOOST_AUTO_TEST_CASE(slash3_slash4)
|
||||
)";
|
||||
|
||||
char const* natspec = R"ABCDEF({
|
||||
"methods": {
|
||||
"methods":
|
||||
{
|
||||
"f()": { "notice": "lorem" }
|
||||
}
|
||||
})ABCDEF";
|
||||
@ -2404,7 +2429,8 @@ BOOST_AUTO_TEST_CASE(error_multiple)
|
||||
|
||||
char const* devdoc = R"X({
|
||||
"methods": {},
|
||||
"errors": {
|
||||
"errors":
|
||||
{
|
||||
"E(uint256,uint256)": [
|
||||
{
|
||||
"details": "an error.",
|
||||
|
Loading…
Reference in New Issue
Block a user