diff options
author | VoR0220 <catalanor0220@gmail.com> | 2016-05-13 11:10:49 +0800 |
---|---|---|
committer | VoR0220 <catalanor0220@gmail.com> | 2016-05-19 04:52:09 +0800 |
commit | 3ba308fb2e4bc910e880431bc708ab4929c7aec2 (patch) | |
tree | 1955d539905dc99240bc75f1ebf733c5973c24ed /test | |
parent | 8efd6dd27a9ae1ccb8391ac326f04dff55129b5f (diff) | |
download | dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.gz dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.bz2 dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.lz dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.xz dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.zst dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.zip |
current debugging info
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index d7f7961a..2b67d084 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -3683,6 +3683,45 @@ BOOST_AUTO_TEST_CASE(zero_handling) BOOST_CHECK(success(text)); } +BOOST_AUTO_TEST_CASE(integer_and_fixed_interaction) +{ + char const* text = R"( + contract test { + function f() { + uint128 a = uint128(1) + ufixed(2); + ufixed b = .5 * uint128(7); + } + } + )"; + BOOST_CHECK(success(text)); +} + +BOOST_AUTO_TEST_CASE(signed_rational_modulus) +{ + char const* text = R"( + contract test { + function f() { + fixed a = 0.42578125 % -0.4271087646484375; + fixed b = .5 % a; + fixed c = a % b; + } + } + )"; + BOOST_CHECK(success(text)); +} + +BOOST_AUTO_TEST_CASE(one_divided_by_three_integer_conversion) +{ + char const* text = R"( + contract test { + function f() { + uint a = 1/3; + } + } + )"; + BOOST_CHECK(!success(text)); +} + BOOST_AUTO_TEST_SUITE_END() } |