diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-23 22:04:43 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-23 23:14:39 +0800 |
commit | 75faed7c55a45770b6b56fa9fe2be308604030a0 (patch) | |
tree | a8c4ec1bb5a017a0f341d6fb31581643f9e160c7 | |
parent | 6d26ad1e61cd6d711332cf3f9df87917157b6a3f (diff) | |
download | dexon-solidity-75faed7c55a45770b6b56fa9fe2be308604030a0.tar.gz dexon-solidity-75faed7c55a45770b6b56fa9fe2be308604030a0.tar.zst dexon-solidity-75faed7c55a45770b6b56fa9fe2be308604030a0.zip |
Add more denomination tests
-rw-r--r-- | test/libsolidity/syntaxTests/denominations/denominations.sol | 5 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/denominations/fixed_point_division.sol | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/denominations/denominations.sol b/test/libsolidity/syntaxTests/denominations/denominations.sol new file mode 100644 index 00000000..de9f73e1 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/denominations.sol @@ -0,0 +1,5 @@ +contract C { + uint constant a = 1 wei + 2 szabo + 3 finney + 4 ether; + uint constant b = 1 seconds + 2 minutes + 3 hours + 4 days + 5 weeks + 6 years; + uint constant c = 2 szabo / 1 seconds + 3 finney * 3 hours; +} diff --git a/test/libsolidity/syntaxTests/denominations/fixed_point_division.sol b/test/libsolidity/syntaxTests/denominations/fixed_point_division.sol new file mode 100644 index 00000000..22331b51 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/fixed_point_division.sol @@ -0,0 +1,6 @@ +contract C { + uint constant a = 4 ether / 3 hours; + ufixed constant b = ufixed(4 ether / 3 hours); +} +// ---- +// TypeError: (32-49): Type rational_const 10000000000000000 / 27 is not implicitly convertible to expected type uint256. Try converting to type ufixed256x62 or use an explicit conversion. |