aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-05 04:53:05 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-11-21 23:50:45 +0800
commit7c051f1e321a406c1a57870f75106151ad70047b (patch)
tree3991f67a382b2b8b0fa1349108a01e6cac840087 /test
parentdcfa5f4ea02f785a0354f145a78f039da25ca485 (diff)
downloaddexon-solidity-7c051f1e321a406c1a57870f75106151ad70047b.tar.gz
dexon-solidity-7c051f1e321a406c1a57870f75106151ad70047b.tar.zst
dexon-solidity-7c051f1e321a406c1a57870f75106151ad70047b.zip
LLL: implement WITH keyword
Diffstat (limited to 'test')
-rw-r--r--test/liblll/EndToEndTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp
index 60aef7b0..aad89b91 100644
--- a/test/liblll/EndToEndTest.cpp
+++ b/test/liblll/EndToEndTest.cpp
@@ -109,6 +109,19 @@ BOOST_AUTO_TEST_CASE(variables)
BOOST_CHECK(callFallback() == encodeArgs(u256(488)));
}
+BOOST_AUTO_TEST_CASE(with)
+{
+ char const* sourceCode = R"(
+ (returnlll
+ (seq
+ (set 'x 11)
+ (with 'y 22 { [0]:(+ (get 'x) (get 'y)) })
+ (return 0 32)))
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callFallback() == toBigEndian(u256(33)));
+}
+
BOOST_AUTO_TEST_CASE(when)
{
char const* sourceCode = R"(