Skip to content

Commit d083925

Browse files
committed
natspecJSON: Generate missing expectations (including errors)
1 parent 481c725 commit d083925

File tree

79 files changed

+1531
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1531
-0
lines changed

test/libsolidity/natspecJSON/custom.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ contract A {
3434
// },
3535
// "version": 1
3636
// }
37+
//
38+
// :A userdoc
39+
// {
40+
// "kind": "user",
41+
// "methods": {},
42+
// "version": 1
43+
// }

test/libsolidity/natspecJSON/custom_inheritance.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,23 @@ contract B is A {
2121
// "version": 1
2222
// }
2323
//
24+
// :A userdoc
25+
// {
26+
// "kind": "user",
27+
// "methods": {},
28+
// "version": 1
29+
// }
30+
//
2431
// :B devdoc
2532
// {
2633
// "kind": "dev",
2734
// "methods": {},
2835
// "version": 1
2936
// }
37+
//
38+
// :B userdoc
39+
// {
40+
// "kind": "user",
41+
// "methods": {},
42+
// "version": 1
43+
// }

test/libsolidity/natspecJSON/dev_author_at_function.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ contract test {
77
}
88

99
// ----
10+
// DocstringParsingError 6546: (73-119): Documentation tag @author not valid for functions.

test/libsolidity/natspecJSON/dev_constructor.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ contract test {
2222
// },
2323
// "version": 1
2424
// }
25+
//
26+
// :test userdoc
27+
// {
28+
// "kind": "user",
29+
// "methods": {},
30+
// "version": 1
31+
// }

test/libsolidity/natspecJSON/dev_constructor_and_function.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ contract test {
4444
// },
4545
// "version": 1
4646
// }
47+
//
48+
// :test userdoc
49+
// {
50+
// "kind": "user",
51+
// "methods": {},
52+
// "version": 1
53+
// }

test/libsolidity/natspecJSON/dev_constructor_return.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ contract test {
66
}
77

88
// ----
9+
// DocstringParsingError 6546: (20-239): Documentation tag @return not valid for constructor.
10+
// DocstringParsingError 2604: (20-239): Documentation tag "@return return should not work within constructors" exceeds the number of return parameters.

test/libsolidity/natspecJSON/dev_contract_doc.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ contract test {
2121
// "title": "Just a test contract",
2222
// "version": 1
2323
// }
24+
//
25+
// :test userdoc
26+
// {
27+
// "kind": "user",
28+
// "methods": {},
29+
// "version": 1
30+
// }

test/libsolidity/natspecJSON/dev_contract_no_doc.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ contract test {
1717
// },
1818
// "version": 1
1919
// }
20+
//
21+
// :test userdoc
22+
// {
23+
// "kind": "user",
24+
// "methods": {},
25+
// "version": 1
26+
// }

test/libsolidity/natspecJSON/dev_default_inherit.sol

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ contract Token is Middle {
4141
// "version": 1
4242
// }
4343
//
44+
// :ERC20 userdoc
45+
// {
46+
// "kind": "user",
47+
// "methods":
48+
// {
49+
// "transfer(address,uint256)":
50+
// {
51+
// "notice": "Transfer ``amount`` from ``msg.sender`` to ``to``. Second line."
52+
// }
53+
// },
54+
// "version": 1
55+
// }
56+
//
4457
// :Middle devdoc
4558
// {
4659
// "kind": "dev",
@@ -59,6 +72,19 @@ contract Token is Middle {
5972
// "version": 1
6073
// }
6174
//
75+
// :Middle userdoc
76+
// {
77+
// "kind": "user",
78+
// "methods":
79+
// {
80+
// "transfer(address,uint256)":
81+
// {
82+
// "notice": "Transfer ``amount`` from ``msg.sender`` to ``to``. Second line."
83+
// }
84+
// },
85+
// "version": 1
86+
// }
87+
//
6288
// :Token devdoc
6389
// {
6490
// "kind": "dev",
@@ -76,3 +102,16 @@ contract Token is Middle {
76102
// },
77103
// "version": 1
78104
// }
105+
//
106+
// :Token userdoc
107+
// {
108+
// "kind": "user",
109+
// "methods":
110+
// {
111+
// "transfer(address,uint256)":
112+
// {
113+
// "notice": "Transfer ``amount`` from ``msg.sender`` to ``to``. Second line."
114+
// }
115+
// },
116+
// "version": 1
117+
// }

test/libsolidity/natspecJSON/dev_default_inherit_variable.sol

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ contract D is C {
2525
// "version": 1
2626
// }
2727
//
28+
// :C userdoc
29+
// {
30+
// "kind": "user",
31+
// "methods":
32+
// {
33+
// "x()":
34+
// {
35+
// "notice": "Hello world"
36+
// }
37+
// },
38+
// "version": 1
39+
// }
40+
//
2841
// :D devdoc
2942
// {
3043
// "kind": "dev",
@@ -38,3 +51,16 @@ contract D is C {
3851
// },
3952
// "version": 1
4053
// }
54+
//
55+
// :D userdoc
56+
// {
57+
// "kind": "user",
58+
// "methods":
59+
// {
60+
// "x()":
61+
// {
62+
// "notice": "Hello world"
63+
// }
64+
// },
65+
// "version": 1
66+
// }

0 commit comments

Comments
 (0)