diff options
author | Balajiganapathi S <balajiganapathi.s@gmail.com> | 2017-10-25 16:12:07 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-08-08 18:05:51 +0800 |
commit | 09a36cba0223c16248335703412cee019c7aa59f (patch) | |
tree | ae444498ba2265538c54d4af63742b8bec32da43 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 0000bfc604b985c47ab153f4172596b860c7cce8 (diff) | |
download | dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.gz dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.bz2 dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.lz dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.xz dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.tar.zst dexon-solidity-09a36cba0223c16248335703412cee019c7aa59f.zip |
Add stricter hex underscore rules
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index a6c1372b..12da1fa1 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -12836,6 +12836,22 @@ BOOST_AUTO_TEST_CASE(write_storage_external) ABI_CHECK(callContractFunction("h()"), encodeArgs(12)); } +BOOST_AUTO_TEST_CASE(test_underscore_in_hex) +{ + char const* sourceCode = R"( + contract test { + function f(bool cond) returns (uint) { + uint32 x = 0x1234_ab; + uint y = 0x1234_abcd_1234; + return cond ? x : y; + } + } + )"; + compileAndRun(sourceCode); + ABI_CHECK(callContractFunction("f(bool)", true), encodeArgs(u256(0x1234ab))); + ABI_CHECK(callContractFunction("f(bool)", false), encodeArgs(u256(0x1234abcd1234))); +} + BOOST_AUTO_TEST_SUITE_END() } |