summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-util.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-04-01 00:02:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-04-01 00:02:49 +0200
commit709334eedec26e284f766072b630fa9171d27086 (patch)
treee26842dfa6838b4d2e18799c87d2d8a040408d04 /tests/unit/core/test-core-util.cpp
parent5f1b2722c8a6cd426a8c8f915d41ccd66a5f854c (diff)
downloadweechat-709334eedec26e284f766072b630fa9171d27086.zip
tests: add tests on function util_parse_delay with unit "ms" (milliseconds)
Diffstat (limited to 'tests/unit/core/test-core-util.cpp')
-rw-r--r--tests/unit/core/test-core-util.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-util.cpp b/tests/unit/core/test-core-util.cpp
index 0d29a832d..eeaa61d2d 100644
--- a/tests/unit/core/test-core-util.cpp
+++ b/tests/unit/core/test-core-util.cpp
@@ -124,6 +124,7 @@ TEST(CoreUtil, ParseDelay)
/* tests with delay == 0 */
LONGS_EQUAL(0, util_parse_delay ("0", 1));
+ LONGS_EQUAL(0, util_parse_delay ("0ms", 1));
LONGS_EQUAL(0, util_parse_delay ("0s", 1));
LONGS_EQUAL(0, util_parse_delay ("0m", 1));
LONGS_EQUAL(0, util_parse_delay ("0h", 1));
@@ -131,12 +132,14 @@ TEST(CoreUtil, ParseDelay)
/* tests with delay == 123, default_factor = 1 */
LONGS_EQUAL(123, util_parse_delay ("123", 1));
LONGS_EQUAL(123, util_parse_delay ("123", 1));
+ LONGS_EQUAL(123, util_parse_delay ("123ms", 1));
LONGS_EQUAL(123 * 1000, util_parse_delay ("123s", 1));
LONGS_EQUAL(123 * 1000 * 60, util_parse_delay ("123m", 1));
LONGS_EQUAL(123 * 1000 * 60 * 60, util_parse_delay ("123h", 1));
/* tests with delay == 123, default_factor = 1000 */
LONGS_EQUAL(123 * 1000, util_parse_delay ("123", 1000));
+ LONGS_EQUAL(123, util_parse_delay ("123ms", 1000));
LONGS_EQUAL(123 * 1000, util_parse_delay ("123s", 1000));
LONGS_EQUAL(123 * 1000 * 60, util_parse_delay ("123m", 1000));
LONGS_EQUAL(123 * 1000 * 60 * 60, util_parse_delay ("123h", 1000));