Skip to content

Commit

Permalink
Add more denomination tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Apr 23, 2018
1 parent 6d26ad1 commit 75faed7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/libsolidity/syntaxTests/denominations/denominations.sol
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 75faed7

Please sign in to comment.