Mercurial > vim
diff src/testdir/test_channel.vim @ 29216:32f3b86352e6 v8.2.5127
patch 8.2.5127: using assert_true() does not show value on failure
Commit: https://github.com/vim/vim/commit/cdc6a43559d5b880f81efceb849f40c20af1ada1
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Jun 19 11:45:46 2022 +0100
patch 8.2.5127: using assert_true() does not show value on failure
Problem: Using assert_true() does not show value on failure.
Solution: Use assert_inrange(). (closes https://github.com/vim/vim/issues/10593)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 Jun 2022 13:00:05 +0200 |
parents | 6b1da12297e5 |
children | 0b47ef4e19b8 |
line wrap: on
line diff
--- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -528,7 +528,7 @@ func Test_connect_waittime() call ch_close(handle) else let elapsed = reltime(start) - call assert_true(reltimefloat(elapsed) < 1.0) + call assert_inrange(0.0, 1.0, reltimefloat(elapsed)) endif " We intend to use a socket that doesn't exist and wait for half a second @@ -1634,8 +1634,7 @@ func Test_exit_callback_interval() let g:exit_cb_val.process = job_info(job).process call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0') let elapsed = reltimefloat(g:exit_cb_val.end) - call assert_true(elapsed > 0.5) - call assert_true(elapsed < 1.0) + call assert_inrange(0.5, 1.0, elapsed) " case: unreferenced job, using timer if !has('timers')