mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds semantic tests to test framework and isoltest.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
return 1;
|
||||
}
|
||||
function g(uint x, uint y) public returns (uint) {
|
||||
return x - y;
|
||||
}
|
||||
function h() public payable returns (uint) {
|
||||
return f();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() -> 1
|
||||
// g(uint256,uint256): 1, -2 -> 3
|
||||
// h(), 1 ether -> 1
|
||||
// j() -> FAILURE
|
||||
// i() # Does not exist. # -> FAILURE # Reverts. #
|
||||
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f(uint a, uint b, uint c, uint d, uint e) public returns (uint) {
|
||||
return a + b + c + d + e;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256,uint256,uint256,uint256,uint256): 1, 1, 1, 1, 1
|
||||
// -> 5
|
||||
// g()
|
||||
// # g() does not exist #
|
||||
// -> FAILURE
|
||||
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
function f(uint a, uint b, uint c, uint d, uint e) public returns (uint) {
|
||||
return a + b + c + d + e;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256,uint256,uint256,uint256,uint256): 1, 1, 1, 1, 1
|
||||
// # A comment on the function parameters. #
|
||||
// -> 5
|
||||
// f(uint256,uint256,uint256,uint256,uint256):
|
||||
// 1,
|
||||
// 1,
|
||||
// 1,
|
||||
// 1,
|
||||
// 1
|
||||
// -> 5
|
||||
// # Should return sum of all parameters. #
|
||||
Reference in New Issue
Block a user