mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add more tests
This commit is contained in:
parent
f91e512f02
commit
57303f1749
16
test/libsolidity/semanticTests/fixedPoint/arrays.sol
Normal file
16
test/libsolidity/semanticTests/fixedPoint/arrays.sol
Normal file
@ -0,0 +1,16 @@
|
||||
contract C {
|
||||
function f() public pure returns (fixed[2] memory ret) {
|
||||
ret[0] = 0.00000000000001;
|
||||
ret[1] = 11111111111111.1;
|
||||
}
|
||||
function g() public pure returns (fixed[] memory ret) {
|
||||
ret = new fixed(3);
|
||||
ret[0] = 998.888888;
|
||||
ret[1] = 44.1100000000011;
|
||||
ret[2] = 888888888888888888.4400001;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() ->
|
||||
// g() ->
|
||||
|
8
test/libsolidity/semanticTests/fixedPoint/constants.sol
Normal file
8
test/libsolidity/semanticTests/fixedPoint/constants.sol
Normal file
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public pure returns (fixed) {
|
||||
return 99.101 * 3.1;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() ->
|
||||
|
@ -8,4 +8,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// z() ->
|
||||
// f() ->
|
||||
|
11
test/libsolidity/semanticTests/fixedPoint/variables.sol
Normal file
11
test/libsolidity/semanticTests/fixedPoint/variables.sol
Normal file
@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f() public pure returns (fixed) {
|
||||
return 1.33;
|
||||
}
|
||||
function g(fixed f1, fixed f2) public pure returns (fixed, fixed, fixed) {
|
||||
return (f2, 0.0000333, f1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() ->
|
||||
// g(fixed128x80,fixed128x80): 9.871, 88888888.0 ->
|
Loading…
Reference in New Issue
Block a user