Skip to content

Commit

Permalink
test: add a test case converting an invalid UTF-8 into a string
Browse files Browse the repository at this point in the history
  • Loading branch information
pirapira committed Nov 25, 2016
1 parent ba94b0a commit aaf58a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/libsolidity/SolidityNameAndTypeResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,16 @@ BOOST_AUTO_TEST_CASE(string)
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)
{
char const* sourceCode = R"(
Expand Down

0 comments on commit aaf58a8

Please sign in to comment.