diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-14 22:58:04 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-15 21:06:26 +0800 |
commit | 6014c3fe16e2d4c42c1bd710661885a5f787a715 (patch) | |
tree | 361d3f39859bda1c1c469402bd7bf3ce7ee0e1f0 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 924a8fff6bc517519eb91ca73adf06505b3f5a87 (diff) | |
download | dexon-solidity-6014c3fe16e2d4c42c1bd710661885a5f787a715.tar.gz dexon-solidity-6014c3fe16e2d4c42c1bd710661885a5f787a715.tar.zst dexon-solidity-6014c3fe16e2d4c42c1bd710661885a5f787a715.zip |
Add tests for scientific notation
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index baed3f1e..21d9074d 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -9176,6 +9176,23 @@ BOOST_AUTO_TEST_CASE(revert) BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(42))); } +BOOST_AUTO_TEST_CASE(scientific_notation) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint) { + return 2e10 wei; + } + function g() returns (uint) { + return 200e-2 wei; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(20000000000))); + BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(2))); +} + BOOST_AUTO_TEST_SUITE_END() } |