0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2357: no test with wrong argument for rand()

Problem:    No test with wrong argument for rand().
Solution:   Add a test case.
This commit is contained in:
Bram Moolenaar
2019-11-28 22:55:43 +01:00
parent f8c1f9200c
commit 68e9e5f7fc
2 changed files with 6 additions and 0 deletions

View File

@@ -25,7 +25,11 @@ func Test_Rand()
let v = rand()
call assert_notequal(v, rand())
if has('float')
call assert_fails('echo srand(1.2)', 'E805:')
endif
call assert_fails('echo srand([1])', 'E745:')
call assert_fails('echo rand("burp")', 'E475:')
call assert_fails('echo rand([1, 2, 3])', 'E475:')
call assert_fails('echo rand([[1], 2, 3, 4])', 'E475:')
call assert_fails('echo rand([1, [2], 3, 4])', 'E475:')

View File

@@ -737,6 +737,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2357,
/**/
2356,
/**/