aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-23 05:33:06 +0800
committerGitHub <noreply@github.com>2017-06-23 05:33:06 +0800
commit79ed529b3fc9fb03460ad3c8e6f1cb05434358b4 (patch)
tree9b42cc52e5861c13f6759587c875e5142def4d25 /test/libsolidity
parent08a5d144ace9392b31a33fd2f051feb7777b93be (diff)
parent7ec9b70457fb8f7eb457aa7a0199ce099c08824c (diff)
downloaddexon-solidity-79ed529b3fc9fb03460ad3c8e6f1cb05434358b4.tar.gz
dexon-solidity-79ed529b3fc9fb03460ad3c8e6f1cb05434358b4.tar.zst
dexon-solidity-79ed529b3fc9fb03460ad3c8e6f1cb05434358b4.zip
Merge pull request #2452 from ethereum/fixPassingEmptyString
Fix passing empty string
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index ba507e0c..823a8eda 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9469,6 +9469,29 @@ BOOST_AUTO_TEST_CASE(revert)
BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(42)));
}
+BOOST_AUTO_TEST_CASE(literal_empty_string)
+{
+ char const* sourceCode = R"(
+ contract C {
+ bytes32 public x;
+ uint public a;
+ function f(bytes32 _x, uint _a) {
+ x = _x;
+ a = _a;
+ }
+ function g() {
+ this.f("", 2);
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("g()") == encodeArgs());
+ BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(0)));
+ BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(2)));
+}
+
BOOST_AUTO_TEST_CASE(scientific_notation)
{
char const* sourceCode = R"(