aboutsummaryrefslogtreecommitdiffstats
path: root/test/libjulia
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-20 00:06:26 +0800
committerchriseth <chris@ethereum.org>2017-09-20 17:16:23 +0800
commit3b813ed29569dde02b965c97c9fdd60469876f66 (patch)
tree20a5ea09ab0bc99d48acabb0e567affb6c381ca4 /test/libjulia
parentc0b3e5b0785efd1b601cff470d3e3d4a71b2c283 (diff)
downloaddexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.gz
dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.zst
dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.zip
Support multiple assignment in inline assembly
Diffstat (limited to 'test/libjulia')
-rw-r--r--test/libjulia/Parser.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp
index 51070370..f8c1aa4d 100644
--- a/test/libjulia/Parser.cpp
+++ b/test/libjulia/Parser.cpp
@@ -249,6 +249,26 @@ BOOST_AUTO_TEST_CASE(recursion_depth)
CHECK_ERROR(input, ParserError, "recursion");
}
+BOOST_AUTO_TEST_CASE(multiple_assignment)
+{
+ CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} 123:u256, x := f() }", ParserError, "Label name / variable name must precede \",\" (multiple assignment).");
+ CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} x, 123:u256 := f() }", ParserError, "Variable name expected in multiple assignemnt.");
+
+ /// NOTE: Travis hiccups if not having a variable
+ char const* text = R"(
+ {
+ function f(a:u256) -> r1:u256, r2:u256 {
+ r1 := a
+ r2 := 7:u256
+ }
+ let x:u256 := 9:u256
+ let y:u256 := 2:u256
+ x, y := f(x)
+ }
+ )";
+ BOOST_CHECK(successParse(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}