mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test: add a test case converting an invalid UTF-8 into a string
This commit is contained in:
parent
ba94b0ae1b
commit
aaf58a8c4e
@ -2038,6 +2038,16 @@ BOOST_AUTO_TEST_CASE(string)
|
|||||||
BOOST_CHECK_NO_THROW(parseAndAnalyse(sourceCode));
|
BOOST_CHECK_NO_THROW(parseAndAnalyse(sourceCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(invalid_utf8)
|
||||||
|
{
|
||||||
|
char const* sourceCode = R"(
|
||||||
|
contract C {
|
||||||
|
string s = "\xa0\x00";
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_ERROR(sourceCode, TypeError, "Invalid UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(string_index)
|
BOOST_AUTO_TEST_CASE(string_index)
|
||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* sourceCode = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user