diff src/testdir/test_assert.vim @ 9636:ccbb8e393d80 v7.4.2095

commit https://github.com/vim/vim/commit/61c04493b00f85d0b97436260a9ef9ab82143b78 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 23 15:35:35 2016 +0200 patch 7.4.2095 Problem: Man test fails when run with the GUI. Solution: Adjust for different behavior of GUI. Add assert_inrange().
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Jul 2016 15:45:05 +0200
parents 6f41d68aa68e
children 0d345265b1e2
line wrap: on
line diff
--- a/src/testdir/test_assert.vim
+++ b/src/testdir/test_assert.vim
@@ -105,6 +105,19 @@ func Test_assert_fail_fails()
   call remove(v:errors, 0)
 endfunc
 
+func Test_assert_inrange()
+  call assert_inrange(7, 7, 7)
+  call assert_inrange(5, 7, 5)
+  call assert_inrange(5, 7, 6)
+  call assert_inrange(5, 7, 7)
+
+  call assert_inrange(5, 7, 4)
+  call assert_match("Expected range 5 - 7, but got 4", v:errors[0])
+  call remove(v:errors, 0)
+  call assert_inrange(5, 7, 8)
+  call assert_match("Expected range 5 - 7, but got 8", v:errors[0])
+  call remove(v:errors, 0)
+endfunc
 
 func Test_user_is_happy()
   smile