comparison src/testdir/test_cscope.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 0da9bc55c31a
children d9378abde532
comparison
equal deleted inserted replaced
19248:5e803caf5e9c 19249:2a017e9dc6da
114 endfor 114 endfor
115 115
116 " Test 10: Invalid find command 116 " Test 10: Invalid find command
117 call assert_fails('cs find x', 'E560:') 117 call assert_fails('cs find x', 'E560:')
118 118
119 " Test 11: Find places where this symbol is assigned a value 119 if has('float')
120 " this needs a cscope >= 15.8 120 " Test 11: Find places where this symbol is assigned a value
121 " unfortunately, Travis has cscope version 15.7 121 " this needs a cscope >= 15.8
122 let cscope_version = systemlist('cscope --version')[0] 122 " unfortunately, Travis has cscope version 15.7
123 let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?')) 123 let cscope_version = systemlist('cscope --version')[0]
124 if cs_version >= 15.8 124 let cs_version = str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?'))
125 for cmd in ['cs find a item', 'cs find 9 item'] 125 if cs_version >= 15.8
126 let a = execute(cmd) 126 for cmd in ['cs find a item', 'cs find 9 item']
127 call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1)) 127 let a = execute(cmd)
128 call assert_equal(' item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.')) 128 call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = LALLOC_CLEAR_ONE(mf_hashitem_T);'], split(a, '\n', 1))
129 cnext 129 call assert_equal(' item = LALLOC_CLEAR_ONE(mf_hashitem_T);', getline('.'))
130 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) 130 cnext
131 cnext 131 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
132 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) 132 cnext
133 cnext 133 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
134 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) 134 cnext
135 endfor 135 call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
136 endfor
137 endif
136 endif 138 endif
137 139
138 " Test 12: leading whitespace is not removed for cscope find text 140 " Test 12: leading whitespace is not removed for cscope find text
139 let a = execute('cscope find t test_mf_hash') 141 let a = execute('cscope find t test_mf_hash')
140 call assert_equal(['', '(1 of 1): <<<unknown>>> test_mf_hash();'], split(a, '\n', 1)) 142 call assert_equal(['', '(1 of 1): <<<unknown>>> test_mf_hash();'], split(a, '\n', 1))