mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extract subdenomination tests
This commit is contained in:
parent
fa2a28abc2
commit
6d26ad1e61
@ -2278,25 +2278,6 @@ BOOST_AUTO_TEST_CASE(explicit_conversion_from_decimal_to_bytesxx)
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(combining_hex_and_denomination)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract Foo {
|
||||
uint constant x = 0x01 wei;
|
||||
}
|
||||
)";
|
||||
CHECK_WARNING(text, "Hexadecimal numbers with unit denominations are deprecated.");
|
||||
|
||||
char const* textV050 = R"(
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract Foo {
|
||||
uint constant x = 0x01 wei;
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(textV050, TypeError, "Hexadecimal numbers cannot be used with unit denominations.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(assigning_value_to_const_variable)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
uint constant x = 0x01 wei;
|
||||
}
|
||||
// ----
|
||||
// Warning: (32-40): Hexadecimal numbers with unit denominations are deprecated. You can use an expression of the form "0x1234 * 1 day" instead.
|
@ -0,0 +1,6 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
uint constant x = 0x01 wei;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (62-70): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 day" instead.
|
Loading…
Reference in New Issue
Block a user