mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add two more exp tests
This commit is contained in:
parent
3ce223c6cb
commit
2f15494f83
@ -974,6 +974,24 @@ BOOST_AUTO_TEST_CASE(overflow_caused_by_ether_units)
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(exp_operator_negative_exponent)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
function f() returns(uint d) { return 2 ** -3; }
|
||||
})";
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(exp_operator_const_overflowed)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
function f() returns(uint d) { return 10 ** 256; }
|
||||
})";
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), InternalCompilerError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user