comparison src/testdir/test_functions.vim @ 19249:2a017e9dc6da v8.2.0183

patch 8.2.0183: tests fail when the float feature is disabled Commit: https://github.com/vim/vim/commit/5feabe00c47fa66d5f4c95213f150488433f78e3 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 30 18:24:53 2020 +0100 patch 8.2.0183: tests fail when the float feature is disabled Problem: Tests fail when the float feature is disabled. Solution: Skip tests that don't work without float support.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Jan 2020 18:30:04 +0100
parents c53dbbf3229b
children 04e1a025ef00
comparison
equal deleted inserted replaced
19248:5e803caf5e9c 19249:2a017e9dc6da
26 call assert_equal(1, empty(0)) 26 call assert_equal(1, empty(0))
27 call assert_equal(1, empty(-0)) 27 call assert_equal(1, empty(-0))
28 call assert_equal(0, empty(1)) 28 call assert_equal(0, empty(1))
29 call assert_equal(0, empty(-1)) 29 call assert_equal(0, empty(-1))
30 30
31 call assert_equal(1, empty(0.0)) 31 if has('float')
32 call assert_equal(1, empty(-0.0)) 32 call assert_equal(1, empty(0.0))
33 call assert_equal(0, empty(1.0)) 33 call assert_equal(1, empty(-0.0))
34 call assert_equal(0, empty(-1.0)) 34 call assert_equal(0, empty(1.0))
35 call assert_equal(0, empty(1.0/0.0)) 35 call assert_equal(0, empty(-1.0))
36 call assert_equal(0, empty(0.0/0.0)) 36 call assert_equal(0, empty(1.0/0.0))
37 call assert_equal(0, empty(0.0/0.0))
38 endif
37 39
38 call assert_equal(1, empty([])) 40 call assert_equal(1, empty([]))
39 call assert_equal(0, empty(['a'])) 41 call assert_equal(0, empty(['a']))
40 42
41 call assert_equal(1, empty({})) 43 call assert_equal(1, empty({}))
114 call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße')) 116 call assert_equal((aw == 'single') ? 6 : 7, strwidth('Straße'))
115 117
116 call assert_fails('call strwidth({->0})', 'E729:') 118 call assert_fails('call strwidth({->0})', 'E729:')
117 call assert_fails('call strwidth([])', 'E730:') 119 call assert_fails('call strwidth([])', 'E730:')
118 call assert_fails('call strwidth({})', 'E731:') 120 call assert_fails('call strwidth({})', 'E731:')
119 call assert_fails('call strwidth(1.2)', 'E806:') 121 if has('float')
122 call assert_fails('call strwidth(1.2)', 'E806:')
123 endif
120 endfor 124 endfor
121 125
122 set ambiwidth& 126 set ambiwidth&
123 endfunc 127 endfunc
124 128
174 call assert_equal(0, str2nr(v:null)) 178 call assert_equal(0, str2nr(v:null))
175 call assert_equal(0, str2nr(v:none)) 179 call assert_equal(0, str2nr(v:none))
176 180
177 call assert_fails('call str2nr([])', 'E730:') 181 call assert_fails('call str2nr([])', 'E730:')
178 call assert_fails('call str2nr({->2})', 'E729:') 182 call assert_fails('call str2nr({->2})', 'E729:')
179 call assert_fails('call str2nr(1.2)', 'E806:') 183 if has('float')
184 call assert_fails('call str2nr(1.2)', 'E806:')
185 endif
180 call assert_fails('call str2nr(10, [])', 'E474:') 186 call assert_fails('call str2nr(10, [])', 'E474:')
181 endfunc 187 endfunc
182 188
183 func Test_strftime() 189 func Test_strftime()
184 CheckFunction strftime 190 CheckFunction strftime
420 call assert_equal('./file', simplify('dir/.././file')) 426 call assert_equal('./file', simplify('dir/.././file'))
421 427
422 call assert_fails('call simplify({->0})', 'E729:') 428 call assert_fails('call simplify({->0})', 'E729:')
423 call assert_fails('call simplify([])', 'E730:') 429 call assert_fails('call simplify([])', 'E730:')
424 call assert_fails('call simplify({})', 'E731:') 430 call assert_fails('call simplify({})', 'E731:')
425 call assert_fails('call simplify(1.2)', 'E806:') 431 if has('float')
432 call assert_fails('call simplify(1.2)', 'E806:')
433 endif
426 endfunc 434 endfunc
427 435
428 func Test_pathshorten() 436 func Test_pathshorten()
429 call assert_equal('', pathshorten('')) 437 call assert_equal('', pathshorten(''))
430 call assert_equal('foo', pathshorten('foo')) 438 call assert_equal('foo', pathshorten('foo'))