comparison src/testdir/test_functions.vim @ 32816:939396a5711c v9.0.1722

patch 9.0.1722: wrong error messages when passing wrong types to count() Commit: https://github.com/vim/vim/commit/4f389e7c0fe7dfeccfa512a72fa36f9028d57159 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Aug 17 22:10:40 2023 +0200 patch 9.0.1722: wrong error messages when passing wrong types to count() Problem: wrong error messages when passing wrong types to count() Solution: fix it This fixes two problems: 1. When passing wrong type to {ic} argument of count(), two error messages are given, the second of which is misleading. 2. When passing wrong type to {comp} argument of count(), the error message doesn't mention that {comp} may be a String. closes: #12825 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 17 Aug 2023 22:15:03 +0200
parents 3868e8035b8c
children 6e53cf9745f4
comparison
equal deleted inserted replaced
32815:fb376df77503 32816:939396a5711c
1747 call assert_equal(0, count("foo", "O")) 1747 call assert_equal(0, count("foo", "O"))
1748 call assert_equal(2, count("foo", "O", 1)) 1748 call assert_equal(2, count("foo", "O", 1))
1749 call assert_equal(2, count("fooooo", "oo")) 1749 call assert_equal(2, count("fooooo", "oo"))
1750 call assert_equal(0, count("foo", "")) 1750 call assert_equal(0, count("foo", ""))
1751 1751
1752 call assert_fails('call count(0, 0)', 'E712:') 1752 call assert_fails('call count(0, 0)', 'E706:')
1753 call assert_fails('call count("", "", {})', ['E728:', 'E728:'])
1753 endfunc 1754 endfunc
1754 1755
1755 func Test_changenr() 1756 func Test_changenr()
1756 new Xchangenr 1757 new Xchangenr
1757 call assert_equal(0, changenr()) 1758 call assert_equal(0, changenr())