aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-01-10 00:49:07 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-05 14:00:59 +0000
commitcc7ccf6d31d14457070055be07884edaf2eb165f (patch)
tree9e292126f1af0a6b9735325912914cecb106b682
parentc97614d98fc7ab040851b7fe1bc4cb575ce8c627 (diff)
downloadrneovim-cc7ccf6d31d14457070055be07884edaf2eb165f.tar.gz
rneovim-cc7ccf6d31d14457070055be07884edaf2eb165f.tar.bz2
rneovim-cc7ccf6d31d14457070055be07884edaf2eb165f.zip
vim-patch:8.1.2357: no test with wrong argument for rand()
Problem: No test with wrong argument for rand(). Solution: Add a test case. https://github.com/vim/vim/commit/68e9e5f7fccb8038cf0ca5b5d95c85a923152f46
-rw-r--r--src/nvim/testdir/test_random.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_random.vim b/src/nvim/testdir/test_random.vim
index ed98433b94..f953b93d51 100644
--- a/src/nvim/testdir/test_random.vim
+++ b/src/nvim/testdir/test_random.vim
@@ -26,7 +26,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:')