aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityNameAndTypeResolution.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-08-06 06:31:35 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-08-06 06:31:35 +0800
commit228fdf633d9e6589eb6769221ebb15eb31099407 (patch)
tree7bc52e7deca4238b8b4f19341de781e6129868e2 /libsolidity/SolidityNameAndTypeResolution.cpp
parent4626890913b9639c886544cd38863b3ecd116ddc (diff)
downloaddexon-solidity-228fdf633d9e6589eb6769221ebb15eb31099407.tar.gz
dexon-solidity-228fdf633d9e6589eb6769221ebb15eb31099407.tar.zst
dexon-solidity-228fdf633d9e6589eb6769221ebb15eb31099407.zip
readd solidity tests
Diffstat (limited to 'libsolidity/SolidityNameAndTypeResolution.cpp')
-rw-r--r--libsolidity/SolidityNameAndTypeResolution.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp
index cfc43df9..6b116f25 100644
--- a/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2149,6 +2149,23 @@ BOOST_AUTO_TEST_CASE(memory_structs_with_mappings)
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
}
+BOOST_AUTO_TEST_CASE(string_bytes_conversion)
+{
+ char const* text = R"(
+ contract Test {
+ string s;
+ bytes b;
+ function h(string _s) external { bytes(_s).length; }
+ function i(string _s) internal { bytes(_s).length; }
+ function j() internal { bytes(s).length; }
+ function k(bytes _b) external { string(_b); }
+ function l(bytes _b) internal { string(_b); }
+ function m() internal { string(b); }
+ }
+ )";
+ BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}