Software /
code /
prosody
Comparison
spec/util_human_io_spec.lua @ 13198:313c49c7566a
util.human.io: Add tests for parse_duration() (some failing)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 16 Jul 2023 19:26:05 +0200 |
parent | 13197:6beec4de8e63 |
comparison
equal
deleted
inserted
replaced
13197:6beec4de8e63 | 13198:313c49c7566a |
---|---|
52 test(60, "1mi"); | 52 test(60, "1mi"); |
53 test(60, "1min"); | 53 test(60, "1min"); |
54 test(60, "1 min"); | 54 test(60, "1 min"); |
55 test(60, "1 minute"); | 55 test(60, "1 minute"); |
56 test(120, "2min"); | 56 test(120, "2min"); |
57 test(7200, "2h"); | |
58 test(7200, "2 hours"); | |
57 test(86400, "1d"); | 59 test(86400, "1d"); |
60 test(604800, "1w"); | |
61 test(604800, "1week"); | |
62 test(1814400, "3 weeks"); | |
58 test(2678400, "1m"); | 63 test(2678400, "1m"); |
64 test(2678400, "1mo"); | |
59 test(2678400, "1month"); | 65 test(2678400, "1month"); |
60 test(2678400, "1 month"); | 66 test(2678400, "1 month"); |
67 test(31536000, "365 days"); | |
68 test(31556952, "1 year"); | |
69 return assert.is_nil(human_io.parse_duration("two weeks"), "\"2 weeks\" -> nil"); | |
61 end); | 70 end); |
62 end); | 71 end); |
63 end); | 72 end); |
64 | 73 |
65 | 74 |