Skip to content

Commit 43f29c0

Browse files
Merge pull request #12724 from ethereum/lsp-tests
Implement & use markers in existing test framework
2 parents 430ecb6 + 0bf674b commit 43f29c0

File tree

6 files changed

+143
-52
lines changed

6 files changed

+143
-52
lines changed

test/libsolidity/lsp/didOpen_with_import.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ contract C
88
function f(uint a, uint b) public pure returns (uint)
99
{
1010
return Lib.add(2 * a, b);
11+
// ^^^^^^^ @diagnostics
1112
}
1213
}

test/libsolidity/lsp/lib.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ enum Color {
2323
library Lib
2424
{
2525
function add(uint a, uint b) public pure returns (uint result)
26+
// ^( @addFunction
2627
{
2728
result = a + b;
2829
}
2930

31+
// ^) @addFunction
3032
function warningWithUnused() public pure
3133
{
3234
uint unused;
35+
// ^^^^^^^^^^^ @diagnostics
3336
}
3437
}
3538

test/libsolidity/lsp/publish_diagnostics_1.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ contract MyContract
66
constructor()
77
{
88
uint unused; // [Warning 2072] Unused local variable.
9+
// ^^^^^^^^^^^ @unusedVariable
910
}
1011
}
1112

1213
contract D
1314
{
1415
function main() public payable returns (uint)
16+
// ^^^^ @unusedReturnVariable
1517
{
1618
MyContract c = new MyContract();
19+
// ^^^^^^^^^^^^ @unusedContractVariable
1720
}
1821
}

test/libsolidity/lsp/publish_diagnostics_2.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ contract C
66
function makeSomeError() public pure returns (uint res)
77
{
88
uint x = "hi";
9+
// ^^^^^^^^^^^^^ @conversionError
910
return;
11+
// ^^^^^^^ @argumentsRequired
1012
res = 2;
1113
}
1214
}
@@ -17,5 +19,6 @@ contract D
1719
{
1820
C c = new C();
1921
return c.makeSomeError(2, 3);
22+
// ^^^^^^^^^^^^^^^^^^^^^ @wrongArgumentsCount
2023
}
2124
}

test/libsolidity/lsp/publish_diagnostics_3.sol

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

88
contract B is A
9+
// ^( @notAbstract
910
{
1011
}
12+
// ^) @notAbstract

0 commit comments

Comments
 (0)