aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_vimscript.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-16 14:25:35 +0800
committerGitHub <noreply@github.com>2024-07-16 06:25:35 +0000
commit598fd77d952364d4dd3433425afe9798dac15206 (patch)
tree71e27a8278791ab97f95f0e382a2fbbcb41c7811 /test/old/testdir/test_vimscript.vim
parent37c7c7547a09cb6fb391f739d08290b782429494 (diff)
downloadrneovim-598fd77d952364d4dd3433425afe9798dac15206.tar.gz
rneovim-598fd77d952364d4dd3433425afe9798dac15206.tar.bz2
rneovim-598fd77d952364d4dd3433425afe9798dac15206.zip
vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738)
Problem: Tests fail when the float feature is disabled. Solution: Skip tests that don't work without float support. https://github.com/vim/vim/commit/5feabe00c47fa66d5f4c95213f150488433f78e3 Cherry-pick Test_ruby_Vim_blob() from patch 8.1.0977 and skip it. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/old/testdir/test_vimscript.vim')
-rw-r--r--test/old/testdir/test_vimscript.vim32
1 files changed, 23 insertions, 9 deletions
diff --git a/test/old/testdir/test_vimscript.vim b/test/old/testdir/test_vimscript.vim
index 1012aca54d..28868a07d6 100644
--- a/test/old/testdir/test_vimscript.vim
+++ b/test/old/testdir/test_vimscript.vim
@@ -6502,16 +6502,22 @@ func Test_type()
call assert_equal(2, type(function("tr", [8])))
call assert_equal(3, type([]))
call assert_equal(4, type({}))
- call assert_equal(5, type(0.0))
+ if has('float')
+ call assert_equal(5, type(0.0))
+ endif
call assert_equal(6, type(v:false))
call assert_equal(6, type(v:true))
+ " call assert_equal(7, type(v:none))
call assert_equal(7, type(v:null))
call assert_equal(v:t_number, type(0))
call assert_equal(v:t_string, type(""))
call assert_equal(v:t_func, type(function("tr")))
+ call assert_equal(v:t_func, type(function("tr", [8])))
call assert_equal(v:t_list, type([]))
call assert_equal(v:t_dict, type({}))
- call assert_equal(v:t_float, type(0.0))
+ if has('float')
+ call assert_equal(v:t_float, type(0.0))
+ endif
call assert_equal(v:t_bool, type(v:false))
call assert_equal(v:t_bool, type(v:true))
" call assert_equal(v:t_none, type(v:none))
@@ -6829,10 +6835,12 @@ func Test_bitwise_functions()
call assert_equal(16, and(127, 16))
eval 127->and(16)->assert_equal(16)
call assert_equal(0, and(127, 128))
- call assert_fails("call and(1.0, 1)", 'E805:')
call assert_fails("call and([], 1)", 'E745:')
call assert_fails("call and({}, 1)", 'E728:')
- call assert_fails("call and(1, 1.0)", 'E805:')
+ if has('float')
+ call assert_fails("call and(1.0, 1)", 'E805:')
+ call assert_fails("call and(1, 1.0)", 'E805:')
+ endif
call assert_fails("call and(1, [])", 'E745:')
call assert_fails("call and(1, {})", 'E728:')
" or
@@ -6840,10 +6848,12 @@ func Test_bitwise_functions()
call assert_equal(15, or(8, 7))
eval 8->or(7)->assert_equal(15)
call assert_equal(123, or(0, 123))
- call assert_fails("call or(1.0, 1)", 'E805:')
call assert_fails("call or([], 1)", 'E745:')
call assert_fails("call or({}, 1)", 'E728:')
- call assert_fails("call or(1, 1.0)", 'E805:')
+ if has('float')
+ call assert_fails("call or(1.0, 1)", 'E805:')
+ call assert_fails("call or(1, 1.0)", 'E805:')
+ endif
call assert_fails("call or(1, [])", 'E745:')
call assert_fails("call or(1, {})", 'E728:')
" xor
@@ -6851,10 +6861,12 @@ func Test_bitwise_functions()
call assert_equal(111, xor(127, 16))
eval 127->xor(16)->assert_equal(111)
call assert_equal(255, xor(127, 128))
- call assert_fails("call xor(1.0, 1)", 'E805:')
+ if has('float')
+ call assert_fails("call xor(1.0, 1)", 'E805:')
+ call assert_fails("call xor(1, 1.0)", 'E805:')
+ endif
call assert_fails("call xor([], 1)", 'E745:')
call assert_fails("call xor({}, 1)", 'E728:')
- call assert_fails("call xor(1, 1.0)", 'E805:')
call assert_fails("call xor(1, [])", 'E745:')
call assert_fails("call xor(1, {})", 'E728:')
" invert
@@ -6862,7 +6874,9 @@ func Test_bitwise_functions()
eval 127->invert()->and(65535)->assert_equal(65408)
call assert_equal(65519, and(invert(16), 65535))
call assert_equal(65407, and(invert(128), 65535))
- call assert_fails("call invert(1.0)", 'E805:')
+ if has('float')
+ call assert_fails("call invert(1.0)", 'E805:')
+ endif
call assert_fails("call invert([])", 'E745:')
call assert_fails("call invert({})", 'E728:')
endfunc