From cc7ccf6d31d14457070055be07884edaf2eb165f Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Mon, 10 Jan 2022 00:49:07 +0000 Subject: [PATCH] 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 --- src/nvim/testdir/test_random.vim | 4 ++++ 1 file changed, 4 insertions(+) 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:')