diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-30 18:24:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-30 18:24:53 +0100 |
commit | 5feabe00c47fa66d5f4c95213f150488433f78e3 (patch) | |
tree | 9e9e980d294d8a3cc5c004f2733538cabef16d86 /src/testdir/test_channel.vim | |
parent | 9f2d020d396132ecbc0be6faa1de29c7078bb5ac (diff) | |
download | vim-git-5feabe00c47fa66d5f4c95213f150488433f78e3.tar.gz |
patch 8.2.0183: tests fail when the float feature is disabledv8.2.0183
Problem: Tests fail when the float feature is disabled.
Solution: Skip tests that don't work without float support.
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r-- | src/testdir/test_channel.vim | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index bd442c2f8..c2068105b 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -202,10 +202,12 @@ func Ch_communicate(port) " Reading while there is nothing available. call assert_equal(v:none, ch_read(handle, {'timeout': 0})) - let start = reltime() - call assert_equal(v:none, ch_read(handle, {'timeout': 333})) - let elapsed = reltime(start) - call assert_inrange(0.3, 0.6, reltimefloat(reltime(start))) + if exists('*reltimefloat') + let start = reltime() + call assert_equal(v:none, ch_read(handle, {'timeout': 333})) + let elapsed = reltime(start) + call assert_inrange(0.3, 0.6, reltimefloat(reltime(start))) + endif " Send without waiting for a response, then wait for a response. call ch_sendexpr(handle, 'wait a bit') @@ -412,6 +414,8 @@ endfunc " Test that trying to connect to a non-existing port fails quickly. func Test_connect_waittime() + CheckFunction reltimefloat + call ch_log('Test_connect_waittime()') let start = reltime() let handle = ch_open('localhost:9876', s:chopt) @@ -927,6 +931,8 @@ func Test_pipe_to_nameless_buffer() endfunc func Test_pipe_to_buffer_json() + CheckFunction reltimefloat + let job = job_start(s:python . " test_channel_pipe.py", \ {'out_io': 'buffer', 'out_mode': 'json'}) call assert_equal("run", job_status(job)) @@ -1423,6 +1429,8 @@ function MyExitTimeCb(job, status) endfunction func Test_exit_callback_interval() + CheckFunction reltimefloat + let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0} let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'}) let g:exit_cb_val.process = job_info(job).process @@ -1768,6 +1776,7 @@ endfunc func Test_job_start_in_timer() CheckFeature timers + CheckFeature reltimefloat func OutCb(chan, msg) let g:val += 1 |