From b1c9d7d2379c91e16fca461f983e2014c720ab8a Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Tue, 10 May 2016 22:22:56 -0700 Subject: vim-patch:7.4.1223 Problem: Crash when setting v:errors to a number. Solution: Free the typval without assuming its type. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/a542c680a8b42cb766e64d4ee7374ef4dacb7832 --- test/functional/legacy/assert_spec.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index 63699387c1..ab6be0ecb7 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -141,6 +141,18 @@ describe('assert function:', function() tmpname_two .. " line 1: 'file two'", }) end) + + it('is reset to a list by assert functions', function() + source([[ + let save_verrors = v:errors + let v:['errors'] = {'foo': 3} + call assert_equal('yes', 'no') + let verrors = v:errors + let v:errors = save_verrors + call assert_equal(type([]), type(verrors)) + ]]) + expected_empty() + end) end) -- assert_fails({cmd}, [, {error}]) -- cgit