comparison src/testdir/test_functions.vim @ 19241:c53dbbf3229b v8.2.0179

patch 8.2.0179: still a few places where range() does not work Commit: https://github.com/vim/vim/commit/b09920203a0f2b202497ef9632f8447f73d0f1fb Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 30 14:55:42 2020 +0100 patch 8.2.0179: still a few places where range() does not work Problem: Still a few places where range() does not work. Solution: Fix using range() causing problems.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Jan 2020 15:00:03 +0100
parents b780229f5792
children 2a017e9dc6da
comparison
equal deleted inserted replaced
19240:b30a4b89d48f 19241:c53dbbf3229b
1953 1953
1954 " setreg() 1954 " setreg()
1955 call setreg('a', range(3)) 1955 call setreg('a', range(3))
1956 call assert_equal("0\n1\n2\n", getreg('a')) 1956 call assert_equal("0\n1\n2\n", getreg('a'))
1957 1957
1958 " settagstack()
1959 call settagstack(1, #{items : range(4)})
1960
1961 " sign_define()
1962 call assert_fails("call sign_define(range(5))", "E715:")
1963 call assert_fails("call sign_placelist(range(5))", "E715:")
1964
1965 " sign_undefine()
1966 call assert_fails("call sign_undefine(range(5))", "E908:")
1967
1968 " sign_unplacelist()
1969 call assert_fails("call sign_unplacelist(range(5))", "E715:")
1970
1958 " sort() 1971 " sort()
1959 call assert_equal([0, 1, 2, 3, 4, 5], sort(range(5, 0, -1))) 1972 call assert_equal([0, 1, 2, 3, 4, 5], sort(range(5, 0, -1)))
1960 1973
1974 " 'spellsuggest'
1975 func MySuggest()
1976 return range(3)
1977 endfunc
1978 set spell spellsuggest=expr:MySuggest()
1979 call assert_equal([], spellsuggest('baord', 3))
1980 set nospell spellsuggest&
1981
1961 " string() 1982 " string()
1962 call assert_equal('[0, 1, 2, 3, 4]', string(range(5))) 1983 call assert_equal('[0, 1, 2, 3, 4]', string(range(5)))
1963 1984
1985 " taglist() with 'tagfunc'
1986 func TagFunc(pattern, flags, info)
1987 return range(10)
1988 endfunc
1989 set tagfunc=TagFunc
1990 call assert_fails("call taglist('asdf')", 'E987:')
1991 set tagfunc=
1992
1993 " term_start()
1994 if has('terminal')
1995 call assert_fails('call term_start(range(3, 4))', 'E474:')
1996 let g:terminal_ansi_colors = range(16)
1997 call assert_fails('call term_start("ls", #{term_finish: "close"})', 'E475:')
1998 unlet g:terminal_ansi_colors
1999 endif
2000
1964 " type() 2001 " type()
1965 call assert_equal(v:t_list, type(range(5))) 2002 call assert_equal(v:t_list, type(range(5)))
1966 2003
1967 " uniq() 2004 " uniq()
1968 call assert_equal([0, 1, 2, 3, 4], uniq(range(5))) 2005 call assert_equal([0, 1, 2, 3, 4], uniq(range(5)))