mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests for type conversion at comparison.
This commit is contained in:
parent
4b9dcd95ce
commit
e22cad4d35
@ -162,6 +162,22 @@ BOOST_AUTO_TEST_CASE(type_checking_function_call)
|
|||||||
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(type_conversion_for_comparison)
|
||||||
|
{
|
||||||
|
char const* text = "contract test {\n"
|
||||||
|
" function f() { uint32(2) == int64(2); }"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(type_conversion_for_comparison_invalid)
|
||||||
|
{
|
||||||
|
char const* text = "contract test {\n"
|
||||||
|
" function f() { int32(2) == uint64(2); }"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(type_inference_explicit_conversion)
|
BOOST_AUTO_TEST_CASE(type_inference_explicit_conversion)
|
||||||
{
|
{
|
||||||
char const* text = "contract test {\n"
|
char const* text = "contract test {\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user