diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-28 00:38:42 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-28 00:38:42 +0800 |
commit | 76465f235221350bbf6e73916bb3eb5d6a5b95e5 (patch) | |
tree | 757908cce056ca43392e2101e709f9d51f285a89 | |
parent | ce4b233f8f58f04d564aedc3061e7ecb1bf9737a (diff) | |
download | dexon-solidity-76465f235221350bbf6e73916bb3eb5d6a5b95e5.tar.gz dexon-solidity-76465f235221350bbf6e73916bb3eb5d6a5b95e5.tar.zst dexon-solidity-76465f235221350bbf6e73916bb3eb5d6a5b95e5.zip |
Add one more type identifier escaping test
-rw-r--r-- | test/libsolidity/SolidityTypes.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityTypes.cpp b/test/libsolidity/SolidityTypes.cpp index ba0e9d4f..852031a7 100644 --- a/test/libsolidity/SolidityTypes.cpp +++ b/test/libsolidity/SolidityTypes.cpp @@ -115,12 +115,13 @@ BOOST_AUTO_TEST_CASE(storage_layout_arrays) BOOST_CHECK(ArrayType(DataLocation::Storage, make_shared<FixedBytesType>(32), 9).storageSize() == 9); } -BOOST_AUTO_TEST_CASE(type_escaping) +BOOST_AUTO_TEST_CASE(type_identifier_escaping) { BOOST_CHECK_EQUAL(Type::escapeIdentifier("("), "$_"); BOOST_CHECK_EQUAL(Type::escapeIdentifier(")"), "_$"); BOOST_CHECK_EQUAL(Type::escapeIdentifier(","), "_$_"); BOOST_CHECK_EQUAL(Type::escapeIdentifier("$"), "$$$"); + BOOST_CHECK_EQUAL(Type::escapeIdentifier(")$("), "_$$$$$_"); BOOST_CHECK_EQUAL(Type::escapeIdentifier("()"), "$__$"); BOOST_CHECK_EQUAL(Type::escapeIdentifier("(,)"), "$__$__$"); BOOST_CHECK_EQUAL(Type::escapeIdentifier("(,$,)"), "$__$_$$$_$__$"); |