vim-patch:7.4.1567

Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.

1abb502635
This commit is contained in:
James McCoy
2016-05-25 17:13:23 -04:00
parent bc306ab5aa
commit ccef5c9c77
3 changed files with 21 additions and 2 deletions

View File

@@ -142,4 +142,22 @@ describe('assert function:', function()
})
end)
end)
-- assert_fails({cmd}, [, {error}])
describe('assert_fails', function()
it('should change v:errors when error does not match v:errmsg', function()
execute([[call assert_fails('xxx', {})]])
expected_errors({"Expected {} but got 'E731: using Dictionary as a String'"})
end)
it('should not change v:errors when cmd errors', function()
call('assert_fails', 'NonexistentCmd')
expected_empty()
end)
it('should change v:errors when cmd succeeds', function()
call('assert_fails', 'call empty("")')
expected_errors({'command did not fail: call empty("")'})
end)
end)
end)