diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-25 20:13:47 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-11-25 20:13:47 +0800 |
commit | aaf58a8c4e802b1c3c4098066e0788e55600660a (patch) | |
tree | 6db342b50a999dafd3e105f0f49acd0fae43da55 | |
parent | ba94b0ae1b6529b9f15ea1023421aa8094f74d49 (diff) | |
download | dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar.gz dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar.bz2 dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar.lz dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar.xz dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.tar.zst dexon-solidity-aaf58a8c4e802b1c3c4098066e0788e55600660a.zip |
test: add a test case converting an invalid UTF-8 into a string
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 6dc7ac8c..6181a8a9 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -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"( |