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

patch 8.0.0794: checking translations fails with multiple NL

Problem:    The script to check translations fails if there is more than one
            NL in one line.
Solution:   Count the number of NL characters.  Make count() accept a string.
This commit is contained in:
Bram Moolenaar
2017-07-28 16:46:57 +02:00
parent 93723a4ef1
commit 9966b21a57
5 changed files with 57 additions and 15 deletions

View File

@@ -635,7 +635,13 @@ func Test_count()
call assert_equal(0, count(d, 'c', 1))
call assert_fails('call count(d, "a", 0, 1)', 'E474:')
call assert_fails('call count("a", "a")', 'E712:')
call assert_equal(0, count("foo", "bar"))
call assert_equal(1, count("foo", "oo"))
call assert_equal(2, count("foo", "o"))
call assert_equal(0, count("foo", "O"))
call assert_equal(2, count("foo", "O", 1))
call assert_equal(2, count("fooooo", "oo"))
endfunc
func Test_changenr()