comparison src/testdir/test_utf8.vim @ 19783:546bdeef35f1 v8.2.0448

patch 8.2.0448: various functions not properly tested Commit: https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 22:23:46 2020 +0100 patch 8.2.0448: various functions not properly tested Problem: Various functions not properly tested. Solution: Add more tests, especially for failures. (Yegappan Lakshmanan, closes #5843)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 22:30:04 +0100
parents 988e5a868b60
children e82996ad131f
comparison
equal deleted inserted replaced
19782:e5f4316b01dd 19783:546bdeef35f1
18 for i in range(len(inp)) 18 for i in range(len(inp))
19 call assert_equal(exp[i][0], strchars(inp[i])) 19 call assert_equal(exp[i][0], strchars(inp[i]))
20 call assert_equal(exp[i][1], inp[i]->strchars(0)) 20 call assert_equal(exp[i][1], inp[i]->strchars(0))
21 call assert_equal(exp[i][2], strchars(inp[i], 1)) 21 call assert_equal(exp[i][2], strchars(inp[i], 1))
22 endfor 22 endfor
23 call assert_fails("let v=strchars('abc', [])", 'E474:')
24 call assert_fails("let v=strchars('abc', 2)", 'E474:')
23 endfunc 25 endfunc
24 26
25 " Test for customlist completion 27 " Test for customlist completion
26 func CustomComplete1(lead, line, pos) 28 func CustomComplete1(lead, line, pos)
27 return ['あ', 'い'] 29 return ['あ', 'い']
97 let save_encoding = &encoding 99 let save_encoding = &encoding
98 set encoding=latin1 100 set encoding=latin1
99 101
100 let lres = str2list(s, 1) 102 let lres = str2list(s, 1)
101 let sres = list2str(l, 1) 103 let sres = list2str(l, 1)
104 call assert_equal([65, 66, 67], str2list("ABC"))
102 105
103 let &encoding = save_encoding 106 let &encoding = save_encoding
104 call assert_equal(l, lres) 107 call assert_equal(l, lres)
105 call assert_equal(s, sres) 108 call assert_equal(s, sres)
106 endfunc 109 endfunc
136 139
137 call assert_equal([text . ' '], ScreenLines(1, 8)) 140 call assert_equal([text . ' '], ScreenLines(1, 8))
138 141
139 bwipe! 142 bwipe!
140 endfunc 143 endfunc
144
145 " vim: shiftwidth=2 sts=2 expandtab