Software /
code /
prosody
Comparison
spec/scansion/prosody.cfg.lua @ 10730:76c9320f69a1
scansion: Mock time libraries during tests
The passage of time does not need test coverage, just look in a mirror.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Apr 2020 18:20:24 +0200 |
parent | 10729:dbce2b94a7eb |
child | 10732:f5d88ad24b30 |
comparison
equal
deleted
inserted
replaced
10729:dbce2b94a7eb | 10730:76c9320f69a1 |
---|---|
1 --luacheck: ignore | 1 --luacheck: ignore |
2 | |
3 -- Mock time functions to simplify tests | |
4 function _G.os.time() | |
5 return 1219439344; | |
6 end | |
7 package.preload["util.time"] = function () | |
8 return { | |
9 now = function () return 1219439344.1; end; | |
10 monotonic = function () return 0.1; end; | |
11 } | |
12 end | |
2 | 13 |
3 admins = { "admin@localhost" } | 14 admins = { "admin@localhost" } |
4 | 15 |
5 use_libevent = true | 16 use_libevent = true |
6 | 17 |