comparison src/testdir/test_functions.vim @ 24695:13efbfc53054 v8.2.2886

patch 8.2.2886: various pieces of code not covered by tests Commit: https://github.com/vim/vim/commit/34fcb697240c1bc9e69417ed75db3b1a83479724 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue May 25 20:14:00 2021 +0200 patch 8.2.2886: various pieces of code not covered by tests Problem: Various pieces of code not covered by tests. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8255)
author Bram Moolenaar <Bram@vim.org>
date Tue, 25 May 2021 20:15:03 +0200
parents 04205b7d67d5
children ca0f983f08cf
comparison
equal deleted inserted replaced
24694:44426ac4b715 24695:13efbfc53054
139 call assert_equal(0, min({})) 139 call assert_equal(0, min({}))
140 call assert_equal(1, min({'a':1, 'b':2})) 140 call assert_equal(1, min({'a':1, 'b':2}))
141 141
142 call assert_fails('call min(1)', 'E712:') 142 call assert_fails('call min(1)', 'E712:')
143 call assert_fails('call min(v:none)', 'E712:') 143 call assert_fails('call min(v:none)', 'E712:')
144 call assert_fails('call min([1, {}])', 'E728:')
144 145
145 " check we only get one error 146 " check we only get one error
146 call assert_fails('call min([[1], #{}])', ['E745:', 'E745:']) 147 call assert_fails('call min([[1], #{}])', ['E745:', 'E745:'])
147 call assert_fails('call min(#{a: [1], b: #{}})', ['E745:', 'E745:']) 148 call assert_fails('call min(#{a: [1], b: #{}})', ['E745:', 'E745:'])
148 endfunc 149 endfunc
713 call assert_fails("let s=tr('abcd', 'abcd', 'def')", 'E475:') 714 call assert_fails("let s=tr('abcd', 'abcd', 'def')", 'E475:')
714 set encoding=latin1 715 set encoding=latin1
715 call assert_fails("let s=tr('abcd', 'abcd', 'def')", 'E475:') 716 call assert_fails("let s=tr('abcd', 'abcd', 'def')", 'E475:')
716 call assert_equal('hEllO', tr('hello', 'eo', 'EO')) 717 call assert_equal('hEllO', tr('hello', 'eo', 'EO'))
717 call assert_equal('hello', tr('hello', 'xy', 'ab')) 718 call assert_equal('hello', tr('hello', 'xy', 'ab'))
719 call assert_fails('call tr("abc", "123", "₁₂")', 'E475:')
718 set encoding=utf8 720 set encoding=utf8
719 endfunc 721 endfunc
720 722
721 " Tests for the mode() function 723 " Tests for the mode() function
722 let current_modes = '' 724 let current_modes = ''
2672 2674
2673 func Test_default_arg_value() 2675 func Test_default_arg_value()
2674 call assert_equal('msg', HasDefault()) 2676 call assert_equal('msg', HasDefault())
2675 endfunc 2677 endfunc
2676 2678
2679 " Test for gettext()
2680 func Test_gettext()
2681 call assert_fails('call gettext(1)', 'E475:')
2682 endfunc
2683
2677 " vim: shiftwidth=2 sts=2 expandtab 2684 " vim: shiftwidth=2 sts=2 expandtab