summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-30 18:24:53 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-30 18:24:53 +0100
commit5feabe00c47fa66d5f4c95213f150488433f78e3 (patch)
tree9e9e980d294d8a3cc5c004f2733538cabef16d86 /src/testdir/test_functions.vim
parent9f2d020d396132ecbc0be6faa1de29c7078bb5ac (diff)
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_functions.vim')
-rw-r--r--src/testdir/test_functions.vim26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 6150a0c3e3..6629d42d56 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -28,12 +28,14 @@ func Test_empty()
call assert_equal(0, empty(1))
call assert_equal(0, empty(-1))
- call assert_equal(1, empty(0.0))
- call assert_equal(1, empty(-0.0))
- call assert_equal(0, empty(1.0))
- call assert_equal(0, empty(-1.0))
- call assert_equal(0, empty(1.0/0.0))
- call assert_equal(0, empty(0.0/0.0))
+ if has('float')
+ call assert_equal(1, empty(0.0))
+ call assert_equal(1, empty(-0.0))
+ call assert_equal(0, empty(1.0))
+ call assert_equal(0, empty(-1.0))
+ call assert_equal(0, empty(1.0/0.0))
+ call assert_equal(0, empty(0.0/0.0))
+ endif
call assert_equal(1, empty([]))
call assert_equal(0, empty(['a']))
@@ -116,7 +118,9 @@ func Test_strwidth()
call assert_fails('call strwidth({->0})', 'E729:')
call assert_fails('call strwidth([])', 'E730:')
call assert_fails('call strwidth({})', 'E731:')
- call assert_fails('call strwidth(1.2)', 'E806:')
+ if has('float')
+ call assert_fails('call strwidth(1.2)', 'E806:')
+ endif
endfor
set ambiwidth&
@@ -176,7 +180,9 @@ func Test_str2nr()
call assert_fails('call str2nr([])', 'E730:')
call assert_fails('call str2nr({->2})', 'E729:')
- call assert_fails('call str2nr(1.2)', 'E806:')
+ if has('float')
+ call assert_fails('call str2nr(1.2)', 'E806:')
+ endif
call assert_fails('call str2nr(10, [])', 'E474:')
endfunc
@@ -422,7 +428,9 @@ func Test_simplify()
call assert_fails('call simplify({->0})', 'E729:')
call assert_fails('call simplify([])', 'E730:')
call assert_fails('call simplify({})', 'E731:')
- call assert_fails('call simplify(1.2)', 'E806:')
+ if has('float')
+ call assert_fails('call simplify(1.2)', 'E806:')
+ endif
endfunc
func Test_pathshorten()