aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-15 21:00:58 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-03-15 21:07:28 +0800
commitb28be08b6d1aeb642fd35e32e2b7627e4eb7cd38 (patch)
treeb541d2e6674407eeef3a3dbe2dbfd999ca8b3cee /test/libsolidity
parentb0a23fa77d4e5f16b3ab1a56000db45748a05838 (diff)
downloaddexon-solidity-b28be08b6d1aeb642fd35e32e2b7627e4eb7cd38.tar.gz
dexon-solidity-b28be08b6d1aeb642fd35e32e2b7627e4eb7cd38.tar.zst
dexon-solidity-b28be08b6d1aeb642fd35e32e2b7627e4eb7cd38.zip
Add tests for negative base
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index ebc9f51e..16b4cc9e 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9189,12 +9189,24 @@ BOOST_AUTO_TEST_CASE(scientific_notation)
function h() returns (uint) {
return 2.5e1;
}
+ function i() returns (int) {
+ return -2e10;
+ }
+ function j() returns (int) {
+ return -200e-2;
+ }
+ function k() returns (int) {
+ return -2.5e1;
+ }
}
)";
compileAndRun(sourceCode, 0, "C");
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(20000000000)));
BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(2)));
BOOST_CHECK(callContractFunction("h()") == encodeArgs(u256(25)));
+ BOOST_CHECK(callContractFunction("i()") == encodeArgs(u256(-20000000000)));
+ BOOST_CHECK(callContractFunction("j()") == encodeArgs(u256(-2)));
+ BOOST_CHECK(callContractFunction("k()") == encodeArgs(u256(-25)));
}
BOOST_AUTO_TEST_SUITE_END()