Skip to content

Commit 68e9e5f

Browse files
committed
patch 8.1.2357: no test with wrong argument for rand()
Problem: No test with wrong argument for rand(). Solution: Add a test case.
1 parent f8c1f92 commit 68e9e5f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/testdir/test_random.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ func Test_Rand()
2525
let v = rand()
2626
call assert_notequal(v, rand())
2727

28+
if has('float')
29+
call assert_fails('echo srand(1.2)', 'E805:')
30+
endif
2831
call assert_fails('echo srand([1])', 'E745:')
32+
call assert_fails('echo rand("burp")', 'E475:')
2933
call assert_fails('echo rand([1, 2, 3])', 'E475:')
3034
call assert_fails('echo rand([[1], 2, 3, 4])', 'E475:')
3135
call assert_fails('echo rand([1, [2], 3, 4])', 'E475:')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ static char *(features[]) =
737737

738738
static int included_patches[] =
739739
{ /* Add new patch number below this line */
740+
/**/
741+
2357,
740742
/**/
741743
2356,
742744
/**/

0 commit comments

Comments
 (0)