mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests for empty and too long strings.
This commit is contained in:
parent
bf8ea705b8
commit
1a76615a87
@ -226,6 +226,22 @@ BOOST_AUTO_TEST_CASE(type_inference_explicit_conversion)
|
|||||||
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(empty_string_literal)
|
||||||
|
{
|
||||||
|
char const* text = "contract test {\n"
|
||||||
|
" function f() { var x = \"\"; }"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(large_string_literal)
|
||||||
|
{
|
||||||
|
char const* text = "contract test {\n"
|
||||||
|
" function f() { var x = \"123456789012345678901234567890123\"; }"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(balance)
|
BOOST_AUTO_TEST_CASE(balance)
|
||||||
{
|
{
|
||||||
char const* text = "contract test {\n"
|
char const* text = "contract test {\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user