diff options
author | James McCoy <jamessan@jamessan.com> | 2016-05-25 17:13:23 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-05-25 21:02:52 -0400 |
commit | ccef5c9c77543fb0cf1b31c82fcb566cca7eff4c (patch) | |
tree | 78718e500714f9de44a207be334c1b731da7c2e4 /test/functional/legacy/assert_spec.lua | |
parent | bc306ab5aa0d2ee7a4653cb1d47615a3f04478a1 (diff) | |
download | rneovim-ccef5c9c77543fb0cf1b31c82fcb566cca7eff4c.tar.gz rneovim-ccef5c9c77543fb0cf1b31c82fcb566cca7eff4c.tar.bz2 rneovim-ccef5c9c77543fb0cf1b31c82fcb566cca7eff4c.zip |
vim-patch:7.4.1567
Problem: Crash in assert_fails().
Solution: Check for NULL. (Dominique Pelle) Add a test.
https://github.com/vim/vim/commit/1abb502635c7f317e05a0cf3ea067101f9d684f5
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r-- | test/functional/legacy/assert_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index 1ce665360d..63699387c1 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -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) |