aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-13 18:22:57 +0800
committerchriseth <c@ethdev.com>2015-10-13 18:22:57 +0800
commit13d7bc4ee8effe78dd496064065717af2cbeacc0 (patch)
treef0799621fd7f60388241c48191b09aaba5d751c9 /test
parentdeebc7e8601185006b74a5ee78b83c50bdf37abc (diff)
downloaddexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar.gz
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar.bz2
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar.lz
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar.xz
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.tar.zst
dexon-solidity-13d7bc4ee8effe78dd496064065717af2cbeacc0.zip
Some more tests and typos fixed.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp25
-rw-r--r--test/libsolidity/SolidityParser.cpp2
2 files changed, 27 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 4316c6a8..b4810af7 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2411,11 +2411,14 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fine)
contract C {
function three() returns (uint, uint, uint);
function two() returns (uint, uint);
+ function none();
function f() {
var (a,) = three();
var (b,c,) = two();
var (,d) = three();
var (,e,g) = two();
+ var (,,) = three();
+ var () = none();
}
)";
BOOST_CHECK_NO_THROW(parseAndAnalyseReturnError(text));
@@ -2464,6 +2467,28 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_4)
SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
}
+BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_5)
+{
+ char const* text = R"(
+ contract C {
+ function one() returns (uint);
+ function f() { var (,) = one(); }
+ }
+ )";
+ SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
+}
+
+BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_6)
+{
+ char const* text = R"(
+ contract C {
+ function two() returns (uint, uint);
+ function f() { var (a, b, c) = two(); }
+ }
+ )";
+ SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index 569530b9..03930479 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -945,6 +945,8 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration)
var (f,) = 4;
var (x,,) = g();
var (,y,) = g();
+ var () = g();
+ var (,,) = g();
}
function g() returns (uint, uint, uint) {}
}