mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
19 lines
453 B
Plaintext
19 lines
453 B
Plaintext
{time: lua_time} = require 'os'
|
|
{:cimport, :eq} = require 'test.unit.helpers'
|
|
|
|
time = cimport './src/os/time.h'
|
|
|
|
describe 'time function', ->
|
|
setup ->
|
|
time.time_init!
|
|
|
|
describe 'mch_delay', ->
|
|
mch_delay = (ms) ->
|
|
time.mch_delay ms, false
|
|
|
|
it 'sleeps at least the number of requested milliseconds', ->
|
|
curtime = lua_time!
|
|
mch_delay 1000
|
|
ellapsed = lua_time! - curtime
|
|
eq true, ellapsed >= 1 and ellapsed <=2
|