summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-10-17 20:43:40 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-10-17 20:43:40 +0200
commit1d56e17b2f0e8f8ce71651729aeb2cab3340a0ad (patch)
tree62d0d41a52b19c35776b91877adbdf0993e72659 /tests/unit
parent5233160d823a10e1a9b2c852a1f68844fa4711d3 (diff)
downloadweechat-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.cpp26
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)");