diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-10-17 20:43:40 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-10-17 20:43:40 +0200 |
commit | 1d56e17b2f0e8f8ce71651729aeb2cab3340a0ad (patch) | |
tree | 62d0d41a52b19c35776b91877adbdf0993e72659 /tests/unit | |
parent | 5233160d823a10e1a9b2c852a1f68844fa4711d3 (diff) | |
download | weechat-1d56e17b2f0e8f8ce71651729aeb2cab3340a0ad.zip |
core: allow floating point and hexadecimal numbers in comparison of evaluated values
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/core/test-eval.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/core/test-eval.cpp b/tests/unit/core/test-eval.cpp index f9e8a2fbb..7bcf542cf 100644 --- a/tests/unit/core/test-eval.cpp +++ b/tests/unit/core/test-eval.cpp @@ -101,6 +101,19 @@ TEST(Eval, EvalCondition) WEE_CHECK_EVAL("0", "2 != 2"); WEE_CHECK_EVAL("0", "18 < 5"); WEE_CHECK_EVAL("0", "5 > 18"); + WEE_CHECK_EVAL("0", "18 < -5"); + WEE_CHECK_EVAL("0", "-5 > 18"); + WEE_CHECK_EVAL("0", "-18 > 5"); + WEE_CHECK_EVAL("0", "5 < -18"); + WEE_CHECK_EVAL("0", "18.2 < 5"); + WEE_CHECK_EVAL("0", "5 > 18.2"); + WEE_CHECK_EVAL("0", "18.2 < -5"); + WEE_CHECK_EVAL("0", "-5 > 18.2"); + WEE_CHECK_EVAL("0", "-18.2 > 5"); + WEE_CHECK_EVAL("0", "5 < -18.2"); + WEE_CHECK_EVAL("0", "2.3e-2 != 0.023"); + WEE_CHECK_EVAL("0", "0xA3 < 2"); + WEE_CHECK_EVAL("0", "-0xA3 > 2"); WEE_CHECK_EVAL("0", "1 == 5 > 18"); WEE_CHECK_EVAL("0", "abc == def"); WEE_CHECK_EVAL("0", "()"); @@ -140,6 +153,19 @@ TEST(Eval, EvalCondition) WEE_CHECK_EVAL("1", "1 != 2"); WEE_CHECK_EVAL("1", "18 > 5"); WEE_CHECK_EVAL("1", "5 < 18"); + WEE_CHECK_EVAL("1", "18 > -5"); + WEE_CHECK_EVAL("1", "-5 < 18"); + WEE_CHECK_EVAL("1", "-18 < 5"); + WEE_CHECK_EVAL("1", "5 > -18"); + WEE_CHECK_EVAL("1", "18.2 > 5"); + WEE_CHECK_EVAL("1", "5 < 18.2"); + WEE_CHECK_EVAL("1", "18.2 > -5"); + WEE_CHECK_EVAL("1", "-5 < 18.2"); + WEE_CHECK_EVAL("1", "-18.2 < 5"); + WEE_CHECK_EVAL("1", "5 > -18.2"); + WEE_CHECK_EVAL("1", "2.3e-2 == 0.023"); + WEE_CHECK_EVAL("1", "0xA3 > 2"); + WEE_CHECK_EVAL("1", "-0xA3 < 2"); WEE_CHECK_EVAL("1", "1 == 18 > 5"); WEE_CHECK_EVAL("1", "abc == abc"); WEE_CHECK_EVAL("1", "(26 > 5)"); |