aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/assert_spec.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-02-27 21:02:57 -0500
committerJames McCoy <jamessan@jamessan.com>2017-02-27 21:40:16 -0500
commitadc6e636fea64a432656d747f3979d682c94d6e2 (patch)
tree15006d5a125d94fd502b43432c9b268e620887a3 /test/functional/legacy/assert_spec.lua
parentf3d8bc8b61fc46f5ff00c10391cb8dd2ce469a53 (diff)
downloadrneovim-adc6e636fea64a432656d747f3979d682c94d6e2.tar.gz
rneovim-adc6e636fea64a432656d747f3979d682c94d6e2.tar.bz2
rneovim-adc6e636fea64a432656d747f3979d682c94d6e2.zip
vim-patch:7.4.2095
Problem: Man test fails when run with the GUI. Solution: Adjust for different behavior of GUI. Add assert_inrange(). https://github.com/vim/vim/commit/61c04493b00f85d0b97436260a9ef9ab82143b78 Only changes related to assert_inrange() were included, since we have a distinct man plugin.
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r--test/functional/legacy/assert_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua
index 8a042be7f7..5c7268486a 100644
--- a/test/functional/legacy/assert_spec.lua
+++ b/test/functional/legacy/assert_spec.lua
@@ -235,6 +235,26 @@ describe('assert function:', function()
end)
end)
+ -- assert_inrange({lower}, {upper}, {actual}[, {msg}])
+ describe('assert_inrange()', function()
+ it('should not change v:errors when actual is in range', function()
+ call('assert_inrange', 7, 7, 7)
+ call('assert_inrange', 5, 7, 5)
+ call('assert_inrange', 5, 7, 6)
+ call('assert_inrange', 5, 7, 7)
+ expected_empty()
+ end)
+
+ it('should change v:errors when actual is not in range', function()
+ call('assert_inrange', 5, 7, 4)
+ call('assert_inrange', 5, 7, 8)
+ expected_errors({
+ "Expected range 5 - 7, but got 4",
+ "Expected range 5 - 7, but got 8",
+ })
+ end)
+ end)
+
-- assert_exception({cmd}, [, {error}])
describe('assert_exception()', function()
it('should assert thrown exceptions properly', function()