diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-06 10:51:26 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-12-06 10:51:26 +0100 |
commit | 5efdbf11d1ef7da72d3de58abecd84edefbaf98a (patch) | |
tree | 2e3128ccf41aa60c8e2826e76c15404848655202 /src/test | |
parent | 471b9850ee10dea07233af485e125897d2d35a00 (diff) |
time-util: accept "µs" as time unit, in addition to "us" (#4836)
Let's accept "µs" as alternative time unit for microseconds. We already accept
"us" and "usec" for them, lets extend on this and accept the proper scientific
unit specification too.
We will never output this as time unit, but it's fine to accept it, after all
we are pretty permissive with time units already.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-time.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-time.c b/src/test/test-time.c index 7078a0374d..8259491813 100644 --- a/src/test/test-time.c +++ b/src/test/test-time.c @@ -42,6 +42,10 @@ static void test_parse_sec(void) { assert_se(u == 2500 * USEC_PER_MSEC); assert_se(parse_sec(".7", &u) >= 0); assert_se(u == 700 * USEC_PER_MSEC); + assert_se(parse_sec("23us", &u) >= 0); + assert_se(u == 23); + assert_se(parse_sec("23µs", &u) >= 0); + assert_se(u == 23); assert_se(parse_sec("infinity", &u) >= 0); assert_se(u == USEC_INFINITY); assert_se(parse_sec(" infinity ", &u) >= 0); |