Skip to content

Commit

Permalink
fix: test miss (done time)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshicho committed Mar 16, 2024
1 parent 396d666 commit f7f8a9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/Async/Promise.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,13 @@ Describe Async.Promise
Assert Equals(p._state, PENDING)
" Timer accuracy fixing need
Assert Equals(P.wait(p, { 'interval': 200 }), ['resolved', v:null])
let done = reltimefloat(reltime(s)) * 1000
if has('mac')
" Because of unstable result time on mac, we will expand the judgment range for the time test
" It underflows and overflows.
Assert Compare(done, '>=', 600)
Assert Compare(done, '<=', 1200)
else
let done = reltimefloat(reltime(s)) * 1000
" interval period | 1 | 2 | 3 | 4 | 5 | 6
" elapsed time |* 0 |* 200 |* 400 |* 600 |* 800 |* 1000
" detect time range | +------+
Expand All @@ -838,13 +838,13 @@ Describe Async.Promise
Assert Equals(p._state, PENDING)
" Timer accuracy fixing need
Assert Equals(P.wait(p, { 'interval': 200 }), [v:null, 'rejected'])
let done = reltimefloat(reltime(s)) * 1000
if has('mac')
" Because of unstable result time on mac, we will expand the judgment range for the time test
" It underflows and overflows.
Assert Compare(done, '>=', 400)
Assert Compare(done, '<=', 1000)
else
let done = reltimefloat(reltime(s)) * 1000
" interval period | 1 | 2 | 3 | 4 | 5 | 6
" elapsed time |* 0 |* 200 |* 400 |* 600 |* 800 |* 1000
" detect time range | +------+
Expand Down

0 comments on commit f7f8a9d

Please sign in to comment.