diff options
author | chriseth <c@ethdev.com> | 2015-07-14 22:37:11 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-07-14 22:40:16 +0800 |
commit | dd3afa2877b06a2f196c2f4c85453b0e2d8ec745 (patch) | |
tree | 3f0ab6020e46c859daec8a6eab62e3d2f3cab52f /libsolidity | |
parent | 27b951842342beed9d6876a2786998dc2e8d6189 (diff) | |
download | dexon-solidity-dd3afa2877b06a2f196c2f4c85453b0e2d8ec745.tar.gz dexon-solidity-dd3afa2877b06a2f196c2f4c85453b0e2d8ec745.tar.zst dexon-solidity-dd3afa2877b06a2f196c2f4c85453b0e2d8ec745.zip |
Fix comparison between bytes types.
Fixes #2087
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/SolidityEndToEndTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp index ad217546..9f806347 100644 --- a/libsolidity/SolidityEndToEndTest.cpp +++ b/libsolidity/SolidityEndToEndTest.cpp @@ -585,6 +585,22 @@ BOOST_AUTO_TEST_CASE(inc_dec_operators) BOOST_CHECK(callContractFunction("f()") == encodeArgs(0x53866)); } +BOOST_AUTO_TEST_CASE(bytes_comparison) +{ + char const* sourceCode = R"( + contract test { + function f() returns (bool) { + bytes2 a = "a"; + bytes2 x = "aa"; + bytes2 b = "b"; + return a < x && x < b; + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(true)); +} + BOOST_AUTO_TEST_CASE(state_smoke_test) { char const* sourceCode = "contract test {\n" |