From 81d8a14a7b020016506d1010ec8d33f7e54cfe8c Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Thu, 5 Feb 2015 00:06:35 +0800 Subject: [PATCH] add a test case for disorder named args --- test/SolidityEndToEndTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/SolidityEndToEndTest.cpp b/test/SolidityEndToEndTest.cpp index d0d501677..f248a5a07 100644 --- a/test/SolidityEndToEndTest.cpp +++ b/test/SolidityEndToEndTest.cpp @@ -102,6 +102,16 @@ BOOST_AUTO_TEST_CASE(named_args) BOOST_CHECK(callContractFunction("b()", bytes()) == toBigEndian(u256(123))); } +BOOST_AUTO_TEST_CASE(disorder_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({c: 3, a: 1, b: 2}); }\n" + "}\n"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("b()", bytes()) == toBigEndian(u256(123))); +} + BOOST_AUTO_TEST_CASE(while_loop) { char const* sourceCode = "contract test {\n"