aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2016-01-12 04:25:59 +0800
committerRJ Catalano <catalanor0220@gmail.com>2016-01-12 04:25:59 +0800
commitac664e7f86593ff3d70576ac475f07f9c91b9ca8 (patch)
tree96c9adab5db2c29cfc801146125f76a8f6597fe1 /test/libsolidity
parentc7df6d03103093356323a3befbcd9d3e9cdfc117 (diff)
downloaddexon-solidity-ac664e7f86593ff3d70576ac475f07f9c91b9ca8.tar.gz
dexon-solidity-ac664e7f86593ff3d70576ac475f07f9c91b9ca8.tar.zst
dexon-solidity-ac664e7f86593ff3d70576ac475f07f9c91b9ca8.zip
final changes to typechecker, the expression compiler, and a couple more tests for good measure
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index c63d8297..3909fc6c 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2862,6 +2862,31 @@ BOOST_AUTO_TEST_CASE(invalid_types_in_inline_array)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(dynamic_inline_array)
+{
+ char const* text = R"(
+ contract C {
+ function f() {
+ uint[4][4] memory dyn = [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]];
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
+BOOST_AUTO_TEST_CASE(lvalues_as_inline_array)
+{
+ char const* text = R"(
+ contract C {
+ function f() {
+ [1, 2, 3]++;
+ [1, 2, 3] = [4, 5, 6];
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}