aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/assert_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-27 04:22:52 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-27 04:22:52 -0400
commit1d63672c77a7a6307a8c99bd8cea59af3f94286a (patch)
tree43ea9138b30267e94f76d956c16509813e718666 /test/functional/legacy/assert_spec.lua
parentbfbc974d13c46ace84bec261263ab044b8c81265 (diff)
parentccef5c9c77543fb0cf1b31c82fcb566cca7eff4c (diff)
downloadrneovim-1d63672c77a7a6307a8c99bd8cea59af3f94286a.tar.gz
rneovim-1d63672c77a7a6307a8c99bd8cea59af3f94286a.tar.bz2
rneovim-1d63672c77a7a6307a8c99bd8cea59af3f94286a.zip
Merge pull request #4821 from jamessan/vim-7.4.1096
vim-patch:7.4.1096,7.4.1567
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r--test/functional/legacy/assert_spec.lua18
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)