mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added new kind of test: check for specific properties of AST
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/// TestCase1: name
|
||||
contract C {
|
||||
///
|
||||
///
|
||||
function f() public pure { }
|
||||
}
|
||||
// ----
|
||||
// TestCase1: C
|
||||
//
|
||||
@@ -0,0 +1,13 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
/// TestCase1: condition.operator
|
||||
/// TestCase2: initializationExpression.initialValue.value
|
||||
/// TestCase3: loopExpression.expression.subExpression.name
|
||||
for(uint i = 1; i < 42; i++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TestCase1: <
|
||||
// TestCase2: 1
|
||||
// TestCase3: i
|
||||
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
/// TestCase1: name
|
||||
/// TestCase2: functionSelector
|
||||
/// TestCase3: visibility
|
||||
function singleFunction() public pure {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TestCase1: singleFunction
|
||||
// TestCase2: 3d33252c
|
||||
// TestCase3: public
|
||||
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
/// TestCase1: condition.operator
|
||||
for(uint i = 0; i < 42; ++i) {
|
||||
}
|
||||
/// TestCase2: initializationExpression.initialValue.value
|
||||
for(uint i = 1; i < 42; i = i * 2) {
|
||||
}
|
||||
/// TestCase3: loopExpression.expression.subExpression.name
|
||||
for(uint i = 0; i < 42; i++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TestCase1: <
|
||||
// TestCase2: 1
|
||||
// TestCase3: i
|
||||
@@ -0,0 +1,9 @@
|
||||
/// TestCase1: nameLocation
|
||||
/// TestCase2: src
|
||||
contract C {
|
||||
function f() public pure {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TestCase1: 115:1:-1
|
||||
// TestCase2: 106:51:-1
|
||||
@@ -0,0 +1,12 @@
|
||||
/// TestContractC: name
|
||||
contract C {
|
||||
/// TestStateVarX: stateVariable
|
||||
uint x;
|
||||
/// TestFunctionF: visibility
|
||||
function f() public pure {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TestContractC: C
|
||||
// TestStateVarX: true
|
||||
// TestFunctionF: public
|
||||
Reference in New Issue
Block a user