comparison src/testdir/test_spell.vim @ 18957:305a7a8d9d4b v8.2.0039

patch 8.2.0039: memory access error when "z=" has no suggestions Commit: https://github.com/vim/vim/commit/569fea2c312126dd5a542c4b1aa51095136a2c0d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 25 13:55:24 2019 +0100 patch 8.2.0039: memory access error when "z=" has no suggestions Problem: Memory access error when "z=" has no suggestions. Solution: Check for negative index.
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Dec 2019 14:00:04 +0100
parents a04da75d3327
children 0413239d2b96
comparison
equal deleted inserted replaced
18956:5d4ff09e5a11 18957:305a7a8d9d4b
239 \ .. " 1 \"Keyboard\"\n" 239 \ .. " 1 \"Keyboard\"\n"
240 \ .. " 2 \"Keyword\"\n" 240 \ .. " 2 \"Keyword\"\n"
241 \ .. "Type number and <Enter> or click with mouse (empty cancels): ", a) 241 \ .. "Type number and <Enter> or click with mouse (empty cancels): ", a)
242 242
243 set spell spellsuggest=0 243 set spell spellsuggest=0
244 " FIXME: the following line is currently commented out as it triggers a 244 call assert_equal("\nSorry, no suggestions", execute('norm z='))
245 " memory error detected in cleanup_suggestions() by asan or valgrind.
246 "call assert_equal("\nSorry, no suggestions", execute('norm z='))
247 245
248 " Unlike z=, function spellsuggest(...) should not be affected by the 246 " Unlike z=, function spellsuggest(...) should not be affected by the
249 " max number of suggestions (2) set by the 'spellsuggest' option. 247 " max number of suggestions (2) set by the 'spellsuggest' option.
250 call assert_equal(['Keyboard', 'Keyword', 'Keyboards'], spellsuggest('Keybord', 3)) 248 call assert_equal(['Keyboard', 'Keyword', 'Keyboards'], spellsuggest('Keybord', 3))
251 249