aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-16 04:47:09 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-16 04:47:09 +0800
commit9ab066de8c157726b9976588b4907496c3489f42 (patch)
treec8ebcf5406f3bb1b7311f8ad8ab081865e82a795 /test/libsolidity
parentaebce8a1d5aa8bf06719341432f487acd347d297 (diff)
downloaddexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar.gz
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar.bz2
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar.lz
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar.xz
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.tar.zst
dexon-solidity-9ab066de8c157726b9976588b4907496c3489f42.zip
new tests
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 73a9b660..605771db 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2743,6 +2743,32 @@ BOOST_AUTO_TEST_CASE(invalid_args_creating_memory_array)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(inline_array_declaration_and_passing)
+{
+ char const* text = R"(
+ contract C {
+ uint[] a;
+ function f() returns (uint, uint) {
+ a = [1,2,3];
+ return (a[3], [3,4][0]);
+ }
+ }
+ )";
+ BOOST_CHECK(success(text));
+}
+
+BOOST_AUTO_TEST_CASE(invalid_types_in_inline_array)
+{
+ char const* text = R"(
+ contract C {
+ function f() {
+ uint[] x = [45, "foo", true];
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}