aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-02-04 08:29:31 +0800
committerGav Wood <i@gavwood.com>2015-02-04 08:29:31 +0800
commit350b99c1d18cbbe7aa980ca9913fd2e1c24987b0 (patch)
treecbf77fa0d76c25bc51530fcd8ec8927039e346d9
parentc3e6dc773d936f25cd1bc7cddf1d7ef901aea6ce (diff)
downloaddexon-solidity-350b99c1d18cbbe7aa980ca9913fd2e1c24987b0.tar.gz
dexon-solidity-350b99c1d18cbbe7aa980ca9913fd2e1c24987b0.tar.zst
dexon-solidity-350b99c1d18cbbe7aa980ca9913fd2e1c24987b0.zip
Test for named args.
-rw-r--r--SolidityEndToEndTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index ced9785e..e019137e 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -92,6 +92,16 @@ BOOST_AUTO_TEST_CASE(multiple_functions)
BOOST_CHECK(callContractFunction("i_am_not_there()", bytes()) == bytes());
}
+BOOST_AUTO_TEST_CASE(named_args)
+{
+ char const* sourceCode = "contract test {\n"
+ " function a(uint a, uint b, uint c) returns (uint r) { r = a * 100 + b * 10 + c * 1; }\n"
+ " function b() returns (uint r) { r = a({a: 1, b: 2, c: 3}); }\n"
+ "}\n";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("b()", bytes()) == toBigEndian(u256(123)));
+}
+
BOOST_AUTO_TEST_CASE(while_loop)
{
char const* sourceCode = "contract test {\n"