forked from aniani/vim
patch 8.1.0958: compiling weird regexp pattern is very slow
Problem: Compiling weird regexp pattern is very slow.
Solution: When reallocating post list increase size by 50%. (Kuang-che Wu,
closes #4012) Make assert_inrange() accept float values.
This commit is contained in:
@@ -190,6 +190,22 @@ func Test_assert_inrange()
|
||||
call remove(v:errors, 0)
|
||||
|
||||
call assert_fails('call assert_inrange(1, 1)', 'E119:')
|
||||
|
||||
if has('float')
|
||||
call assert_equal(0, assert_inrange(7.0, 7, 7))
|
||||
call assert_equal(0, assert_inrange(7, 7.0, 7))
|
||||
call assert_equal(0, assert_inrange(7, 7, 7.0))
|
||||
call assert_equal(0, assert_inrange(5, 7, 5.0))
|
||||
call assert_equal(0, assert_inrange(5, 7, 6.0))
|
||||
call assert_equal(0, assert_inrange(5, 7, 7.0))
|
||||
|
||||
call assert_equal(1, assert_inrange(5, 7, 4.0))
|
||||
call assert_match("Expected range 5.0 - 7.0, but got 4.0", v:errors[0])
|
||||
call remove(v:errors, 0)
|
||||
call assert_equal(1, assert_inrange(5, 7, 8.0))
|
||||
call assert_match("Expected range 5.0 - 7.0, but got 8.0", v:errors[0])
|
||||
call remove(v:errors, 0)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_assert_with_msg()
|
||||
|
||||
Reference in New Issue
Block a user