mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests for negative base
This commit is contained in:
parent
b0a23fa77d
commit
b28be08b6d
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user