diff options
author | chriseth <c@ethdev.com> | 2015-03-10 02:22:43 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-10 02:22:43 +0800 |
commit | 0fcd2212d494239b41ddbf1a18328a77fe186558 (patch) | |
tree | e8f5951f7fa2850cc2be25e86f68ca9c0e573caa /SolidityEndToEndTest.cpp | |
parent | d586a88f3cab21db88f31dd574daac4bb9a28b7d (diff) | |
download | dexon-solidity-0fcd2212d494239b41ddbf1a18328a77fe186558.tar.gz dexon-solidity-0fcd2212d494239b41ddbf1a18328a77fe186558.tar.zst dexon-solidity-0fcd2212d494239b41ddbf1a18328a77fe186558.zip |
Global variable "now" (alias for block.timestamp).
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r-- | SolidityEndToEndTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index ae241705..3205c038 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -1031,6 +1031,17 @@ BOOST_AUTO_TEST_CASE(blockchain) BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, 0, 1)); } +BOOST_AUTO_TEST_CASE(now) +{ + char const* sourceCode = "contract test {\n" + " function someInfo() returns (bool success) {\n" + " return block.timestamp == now && now > 0;\n" + " }\n" + "}\n"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("someInfo()") == encodeArgs(true)); +} + BOOST_AUTO_TEST_CASE(function_types) { char const* sourceCode = "contract test {\n" |